I am writing a simple for loop on my Mac with Xcode, and I've seem to run into the problem of (of course, very noobish probably) an undeclared identifier. Could someone explain to me what it is here?
Well, the compiler needs to allocate some place in memory to hold the variable i, and it also need to know what sort of code to generate when dealing with it. In order for it to do that, it needs to know what type of thing i represents. For example is it a string, or a character, or an integer, or a float, or a double, or ...
Now I can't see that information stated anywhere. I can guess that you most likely intend for it to be an int. But the compiler can't guess, it needs to be told.
So either put int i; somewhere before line 17. Or better, change line 17 to read for (int i = 0; i < 20; i++)