It will work, just as it used to, however you are still instantiating the variables when you don't need to.
Consider this:
1) You declare x (which becomes basically random because its whatever was in memory at that spot)
2) You change the value of x to the value of scanf
3) ...
Now consider this:
1) You declare x and set it to 4
2) You change the value of x to the value of scanf
3) ...
If you are going to assign x in step 2, there's no need to set it in step 1. (Note that this is not a big deal at all, but your computer will have to load x from memory, set it to 4, then store it in memory if you give it a value)
So you can do:
Code:
int main(int argc, char *argv[])
{
int x;
int y;
...
What I was saying about assigning it to 0 is if you were expecting it to already be 0. For example:
Code:
int x;
while (somecondition)
{
x++;
}
If somecondition lasts 4 times, you might want to think x would be 4, however it really won't be because it was initialized as whatever number was in memory.