Tell me more ×  I came across a piece of advise in stack
overflow which mentions about When to use and when not to user
forward declaration .  I came across this :-  struct X;
// Forward declaration of X  void f1(X* px) {}      // Legal:
can always use a pointer/reference X f2(int);             //
Legal: return value in function prototype void f3(X);
// Legal: parameter in function prototype void f4(X) {}
// ILLEGAL: *definitions* require complete types`  The last line
Which says illegal will fail while compilation.  void f3(X); //
Works perfectly fine   So is it that all header files (.hh) are
first scanned by compiler and then all .cc file looked for
syntax and symantics where we actually can define the void
f3(X); as after scanning through header files compiler will have
idea about X its member function and member  share|improve this
question How is this related to Java? –  Luchian Grigore Mar 28
'12 at 6:52 What's the question? –  David Schwartz Mar 28 '12 at
6:54 @Luchian