Okay, I'm finally getting to something totally new to me in my "Learn C on a Mac" book.
The book says that in the following code, the error is when the function DrawDots() tries to reference the variable numDots.
Where can I recognize that DrawDots() is trying to reference numDots??
I see that numDots = 500; is directly above DrawDots(); but they are on two separate lines, and i don't see how one has anything to do with the other? Where is DrawDots(); trying to reference numDots;? Each line makes no reference of the other.
The book says that in the following code, the error is when the function DrawDots() tries to reference the variable numDots.
Where can I recognize that DrawDots() is trying to reference numDots??
I see that numDots = 500; is directly above DrawDots(); but they are on two separate lines, and i don't see how one has anything to do with the other? Where is DrawDots(); trying to reference numDots;? Each line makes no reference of the other.
Code:
#include <stdio.h>
int main (int argc, const char * argv[]) {
int numDots;
numDots = 500;
DrawDots();
return 0;
}
void DrawDots( void ) {
int i;
for ( i = 1; i <= numDots; i++ )
printf (".");
}