Help on #includes in C++

Started by
1 comment, last by wiseduck 18 years, 7 months ago
Hi there people! I just started learning C++ (already program in JAVA for 2 years) and I am having hard time figuring out the best way to employ #include's in my codes. It appears everyone puts Class definitions and functions prototypes in header files. That's ok! But when I am about to link, for eg., foo.h and foo.cc to goo.h and goo.cc, Should I include foo.h or foo.cc? And in which goo file (goo.h or goo.cc)? Also I want to know if there are any possible problems of #include'ing the same library many times in a project. For eg., <iostream> in foo.h and the same <iostream> in goo.h.
Advertisement
Everything you ever wanted to know about include files.
Thank you man, very insightful!

This topic is closed to new replies.

Advertisement