Hi, when compiling my program, I’ve found that functions called in VCS don’t run unless declared above the line that calls it (i.e the whole function has to be written above the main() code). Is there a way to declare functions at the top of the program while writing them out somewhere lower down?
void thisIsAFunctionThatDoesStuff(); //Declare function
int main() {
thisIsAFunctionThatDoesStuff(); //Call function
return 0;
}
void thisIsAFunctionThatDoesStuff() { //Define function
// Do stuff
}
1 Like