Ok so, I know that if you declare a variable inside an if statement, then the variable will exist only inside the if block. But what about in loops? If I do something like:
Code:
for(whatever;bla;etc.) {
    int x;
    bla bla bla...;
}
Is it efficient? I thought that maybe it could declare multiple times the variable and be inefficient actually, but I'm not sure.

Thing is that I want to declare a variable that will only be used inside the for. I have seen the declaration inside the for parentheses:
Code:
for(int x; bla; bla)
But the compiler gives me a warning, something about not C99.

Thanks.