R
raphfrk
When I use gcc for compiling my program, I can define variables
anywhere in the program, e.g.
int a;
<code using a>
int b;
<code using b (and/or a)>
However, when I sent the code to someone else they were unable to
compile it (They are using some IDE compiler)
I vaguely remember that originally, variables needed to be defined all
at the start of the program.
Is there a simple switch that needs to be set to allow variables to be
defined anywhere?
Also, I think if I move all the variable definitions to the start of
the program, they should be able to compile, but I would rather not do
that.
anywhere in the program, e.g.
int a;
<code using a>
int b;
<code using b (and/or a)>
However, when I sent the code to someone else they were unable to
compile it (They are using some IDE compiler)
I vaguely remember that originally, variables needed to be defined all
at the start of the program.
Is there a simple switch that needs to be set to allow variables to be
defined anywhere?
Also, I think if I move all the variable definitions to the start of
the program, they should be able to compile, but I would rather not do
that.