|
From: <ric...@ya...> - 2001-04-09 08:09:08
|
Hi. I'd be grateful if someone could write a few lines to help me understand header files. I know that #include is used to read source code from a file into the current file, and that MyClass.h holds the declaration of a class whereas MyClass.cpp holds the definition of the class. The MyClass.cpp file has a #include "MyClass.h" so that it reads in the class declaration. I'm a bit confused as to why, in any examples I see, a main.cpp file uses #include "MyClass.h": shouldn't the main.cpp file require both the class declaration and its definition? Many thanks. Richard ____________________________________________________________ Do You Yahoo!? Get your free @yahoo.co.uk address at http://mail.yahoo.co.uk or your free @yahoo.ie address at http://mail.yahoo.ie |