|
When the compiler compiles Circle x, it must know how much memory overhead x is, so if there is no class structure declaration, including the definition of member variables, it cannot be compiled, if you must put the declaration behind, only use pointers.
Circle * x = (Circle *) operator new (4); // This is no problem, because the pointer is always four bytes
But even so, when you use X, you still need to declare the prototype of the class.If you write it all to the back, it is like you define a global variable and use it without adding a declaration in front. |
|