Posted by Firas Al-Barzinji on October 29, 2001 at 02:52:24:
In Reply to: local & variable in main posted by John on October 26, 2001 at 23:49:42:
: I declare one variable in main to pass it around (int&...), then I declare another local variable inside a for loop, then I compare the two, but it's not working, anyone knows why ?
: for (int a; int a <= ...; a ++)
you need to either initialize the variable with a value when you start the for loop (for (int a=0;...) or initialize it somewhere else without defining it again in the loop - ( for( a; ...)
Post a Followup