Had the same problem and the above code also works for me. UsingOriginally Posted by vexon
g++ (GCC) 3.4.4 20050721 (Red Hat 3.4.4-2)
extern StructureName variableName may declare that there is a variable of StructureName however I am not sure how the declaration is done but to bring more light if you do not declare the varialble in your .cc file then the linker complains that the variable is undeclared. So my thought would be that if in your program you try to do (without declaring the structure variable in the source file):
then reservation of memory should be wrong.Code:afheader.m_figthernumber = 3;
Imagine you also had the following members to your structure definition:
then would the above statement reserve memory for these fields??? In other words will the above statement declare (ie reserve memory) for a structure variable or just for an integer variable????Code:short friendlyFighters; short enemyFighters;
Just a thought, the C gurus could give more light.