What's the difference between these two for loops? I was told not to use the second example in my code. I'm baffled by this since It's not a problem in other languages.
So what's the difference/issue with this or is it only a preference?
//ex1
int i;
for(i = 0; i<whatever; i++){...code}
//ex2
for(int i=0; i<whatever;i++){...code}