about pre-compile #include directive

I have three source files
main.cpp (include func.h)
func.cpp
func.h (include functions defined in func.h)

if I have written #include <fstream>
in func.cpp
do I need to type in #include <fstream>
in func.h
and main.cpp?

why?
thanks
if you need fstream in all those files, you can have it just in func.h as it is included in the other files.
If you include it in func.cpp you will need to include it also in the other files
Topic archived. No new replies allowed.