I am really stuck with something, it took me a while to work out why but it seems c++ does no passing to gain knowelage of identifiers.
eg, this doesnt work:
1 2 3 4 5 6 7 8 9
void a ()
{
b();
}
void b ()
{
do something
}
Is there a compiler directive or something to tell it that post-declarations exist? The only way i have found so far is to create a prototype of it :/ problem is i have 100s of functions that i would rather keep in alphabetical order.
void a ();
void b ();
void c ();
// et cetera, et cetera
int main()
{
//your main stuff
}
void a ()
{
// ...
b();
}
void b ()
{
//do whatever
}
//et cetera again, et cetera again
MAKE SURE YOU PROTOTYPE. I cannot stress that enough, even if I bolded it, italicized it, and underlined it.
Hmm ok thanks, looks like i am stuck with prototypes (I am a c# programmer normally so have been spoiled with the ability to declare stuff all over the place :)
So how can you pre-declare classes and functions or items in separate namespaces/classes then?