My program compiles without any errors and runs perfectly, but I am getting a warning that I'm not sure about if you guys can give me some advice it would be most appreciated...
It says "warning: comparison between pointer and integer" I understand that it doesn't like: [I]firstname != NULL ... Well, what's odd is firstname[i] isn't a pointer, it's an array.
Code:
#include <stdio.h>
#include <string.h>
int tolower(int c);
int main(int argc, const char * argv[]) {
int i;
char firstname[20];
strcpy( firstname, "STEVEN" );
for ( i = 0 ; firstname[i] != NULL ; i = i + 1 ) {
// warning: comparison between pointer and integer
printf( "%c", tolower( firstname[i] ) );
}
return 0;
}