Just a little dumb question.
You know, when declaring a variable it is pushed onto the stack and is then accessed through some addressing relative the stack pointer, right?
My question is, when a function is called are all variables pushed directly at the call or can they be pushed later if you wait with the declaration?
In the exampple above, will Var2 always be pushed or only when Arg is not 'something'?Code:void Func(int Arg) { int Var1; if(Arg == something) return; int Var2; }
I usually declare all my variables at the top to easily see what are used in the function, but for speed (duh!) it may be better to wait with the declaration until they are actually used?
...Just me being bored and having nothing better to think of...