cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
about pre-compile #include directive
about pre-compile #include directive
May 13, 2009 at 5:23pm UTC
nanger
(71)
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
May 13, 2009 at 5:28pm UTC
Bazzy
(6281)
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.