It is also useful to allow flexible code organization, for example if one wishes to place the main body at the top, and called functions below it.
In these cases identifiers must be defined (variables initialized, functions defined) before they can be employed during runtime without the need for pre-definition in the source code for either compilation or interpretation: identifiers do not need to be immediately resolved to an existing entity.
During compilation time these are initialized by language specific rules (to undefined values, 0, NULL pointers, ...).
In C, the same general rule applies, but with an exception for undeclared functions and incomplete types.
In Objective-C, classes and protocols can be forward-declared like this: In Objective-C, classes and protocols can be forward-declared if you only need to use them as part of an object pointer type, e.g. MyClass * or id
C++ generally prohibits forward references, but they are allowed in the special case of class members.