R
Ramon F Herrera
My program's files are structured like this:
- a small 'main.cpp' file, all it does is to call a class
- a rather large 'myclass.cpp' file, it contains the instantiation
public member and a lot of private stuff.
- a 'myclass.h' file which I have been unable to write properly. It
should have the declarations of its *.cpp counterpart.
Compile works fine, but the only way I have been able to link is by
having this line:
#include "myclass.cpp" <== I would like to have "myclass.h" here!
in the "main.cpp" file.
Needless to say the above is wasteful, since the "myclass.cpp" file is
probably compiled -or at least scanned- twice.
In this BOOK that I am READING, the author declares the whole
enchilada, and I don't understand why. I would only declare the public
part.
http://tinyurl.com/mwpq3b (Page 293, "Declarations and Definitions")
TIA,
-Ramon
- a small 'main.cpp' file, all it does is to call a class
- a rather large 'myclass.cpp' file, it contains the instantiation
public member and a lot of private stuff.
- a 'myclass.h' file which I have been unable to write properly. It
should have the declarations of its *.cpp counterpart.
Compile works fine, but the only way I have been able to link is by
having this line:
#include "myclass.cpp" <== I would like to have "myclass.h" here!
in the "main.cpp" file.
Needless to say the above is wasteful, since the "myclass.cpp" file is
probably compiled -or at least scanned- twice.
In this BOOK that I am READING, the author declares the whole
enchilada, and I don't understand why. I would only declare the public
part.
http://tinyurl.com/mwpq3b (Page 293, "Declarations and Definitions")
TIA,
-Ramon