c++ - Why other class names are specified above a class? -
possible duplicate:
when use forward declaration?
what use of specifying other class names above particular class?
class a; class b; class c { ... ... };
it's forward declaration.
as hangover c, c++ compiler works in top-to-bottom fashion (more or less). if want class c refer class a or class b in way (via pointer or reference), compiler must know existence beforehand.
Comments
Post a Comment