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

Popular posts from this blog

c++ - Is it possible to compile a VST on linux? -

java - Output of Eclipse is rubbish -

jquery - Confused with JSON data and normal data in Django ajax request -