Iím teaching myself C++ from a textbook and thereís a convention Iím starting to notice that doesnít make sense to me, and itís not explained in the book.
When creating a class, the convention seems to be to put the class declaration in a header file and put the member functions in a .cpp file. That part I understand, but the way the files are #included seems strange...
When you include a class definition in a program, you #include the header file for that class, right? But the header file doesnít #include itís .cpp counterpart, in fact it seems to be the other way around.
Why is it done this way? Seems like the program file should #include the .cpp file for the class instead of the header file.