Order-Specific Code?

Hello! I've been working on a small project. However, when I attempt to declare a function further down in the script than where it is used (Function is globally declared, called inside of another function) then it calls an error and treats it as undefined, forcing me to move it up. Is this normal C/C++ behavior that I haven't noted until now or is this an actual issue?

Can you give an example so that we understand what you mean better?

Do you mean code like this?

void secondFunc(void)

void firstFunc(void)
  //func defined

void setup() {
  // put your setup code here, to run once:


void loop() {
  // put your main code here, to run repeatedly:


Or did you add the prototype for the firstFunc() before you tried to use it in secondFunc()? Like

void firstFunc(void);

If you did the first, then yes, and error is normal, because as far as the compiler is concerned, you have tried to use firstFunc before you have even told it that firstFunc exists. If the latter, then no, that is an error. However, I couldn't replicate the first instance on Arduino Create, but it did fail as expected on the desktop Arduino IDE.

Yeah, first one. Is there any way to make it non-order specific, or is this just a quirk of C / C++ I have to get used to?