Hi all. Newbie to Arduino here, but I’m fairly experienced with C programming. I’m trying to understand if the analogy between separate tabs in Arduino sketches and separate .c files on other platforms is exact with respect to the scope of global variables and functions.
On other platforms global variables (a.k.a. external variables -- not defined within a function) and functions in one .c file can be accessed in another file by using ‘extern’ declaration and the linker will sort things out. Also, these same global variables and functions can be hidden and confined to a single file by using ‘static’ in their definition.
But, I’ve read that in Arduino all the tabs are combined into a single entity (alphabetically by tab name) before compilation. If that’s the case, then these scope rules might be altered depending on where the definitions appear in the combined entity.
Appreciate any help in understanding this.