0
So declaring a variable as the same value results in a syntax error? but re-declaring the variable is okay?
Also is there anything else that prompts a syntax error?
1 Answer
0
if I'm understanding you correctly then this should help.
if you do something like
int main ()
{
int i = 0;
int i = 1;
}
then you'll get an error because i already exists when you try to initialize it with 1. however, if you do
int main ()
{
int i = 0;
i = 1;
}
then you'll get no errors since your only changing the value inside i.