I didnt think you could declare a function, say
void idle(float);
in one source file, and then define it in a different file?
It seems to be working fine, I just didnt think it was supposed to?
Im useing MSVC
I didnt think you could declare a function, say
void idle(float);
in one source file, and then define it in a different file?
It seems to be working fine, I just didnt think it was supposed to?
Im useing MSVC
> I just didnt think it was supposed to?
Why not? If you had to define the function in each compiled file you'd get re-definition errors. Functions can be seen anywhere in the translation unit by default and can be used in any file where they are declared. If you want to 'hide' a function in a file you can do -
static void idle(float){//do stuff}
Usually when a function idle is defined in file A, then in file B it is referred to as:
extern void idle (float);