Class definition information is usually very compact and frequently needed to define variables of that class when you write a program that uses that class.
Class implementation information is usually very bulky (thousands of lines of code !!!) and only needed when the program is run
The complete class definition must be in a single file
Member function can be stored in one or more program files (it is not required to store all member functions of a class in a single file)
In fact, the situation can be pretty bad: you can use one file to store member functions from different classes !!!
class Matrix3x3 { public: float A[3][3]; void AddNum(float x) { int i, j; for (i = 1; i < 3; i = i + 1) for (j = 1; j < 3; j = j + 1) A[i][j] = A[i][j] + x; }; }; |
|
For example, C++ compiler need to know what things are inside a Matrix3x3 variables: array A[3][3] !!!