This has been on my mind for a while and finally it caught up to me by not working ....meaning:
Can anyone explain and provide a best way of placing and especiall a way of including (.h) and (.cpp) files witing a project.
What I mean is: I have a very simple class whose declaration is inside of (.h) file and it's implementation resides in (.cpp) file respecitvely.
I was always under an impression that AT THE END (below all of the code) of my (.h) header file i must put:
and in my (.cpp) implementation file i don't include anything...Code:#include"myclass.cpp"
and finally in (for example) main.cpp file (where my main() function is) i include my (.h) header file only and NOT the (.cpp) file, which obviously is its implementation.
Well, I always wanted to find out, however none of the books nor resourses illustrate its complete and proper use and exact placement.
Most of the books that I have simply include (.h) header file inside of the (.cpp) implementation file, however they don't show what one must include in the main file where main() starts the program.
To make the long story short, my compiler (Microsoft Visual C++ .NET) craps out and keeps saying that my class is NOT declared.????
Can anyone please help??