external declares
external declares
- Subject: external declares
- From: Robert Dell <email@hidden>
- Date: Fri, 10 Feb 2006 20:25:13 -0500
they seem to think this is off topic for the cocoa list so i'll ask here.
i broke up my 40,000 line program into smaller includes. one of which is the reqs calculator section and all routines needed to do that.
i noticed i needed to declare my variables as external references such as:
(within reqs.c)
extern long currentCircle;
extern long nextCircle;
extern long calcCircle;
but when i got to this part, i noticed i had forgotten to declare this as external but it still worked...
(from within the main program file, not the included reqs.c file)
struct expskill
{
char skillname[80];
long skillvalue;
long skillreqs;
long skillNeeded;
long skillexclude;
} myarmor[8], myweapon[25], mymagic[5], mysurvival[15], mylore[13], myinstruments[5], swap;
later on, i have the following in the main program file
#include "reqs.c"
so far, so good...
my next question is dumbfounding to me...
why did the compiler scream at me when i didn't declare "nextCircle" as an external variable or at all because of "undeclared identifier" but it allowed "myarmor[1].skillvalue"
where did it get it's information from to know myarmor is a structure and it's dimensions but NOT know nextCircle is a simple longint value?
mind you, the compiler errored out before i added all the extern long declarations.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden