This is probably very basic but I'm not sure where I'm going wrong here...I want to have a loop going through numbers from 0 through 90 in increments of 5, and making them into strings ("00", "05", "10", etc.), so I have this:
But when I print the value of inc to test that this is working, it seems to be only taking in the first digit of each number (so I get 0,5,1,1,2,2,etc.)...what am I doing wrong?Code:int i;
char inc[10];
for (i = 10; i <= 90; i += 5) {
sprintf(inc, "%d", i);
printf("%c\n", *inc); //Tests
//Does stuff with the string inc
}