I have the following code:
char alfabeto[] = {'a','b','c','d','e','f','g','h','i','j','k','l','m',
'n','o','p','q','r','s','t','u','v','w','x','y','z'};
int i = 0;
printf("|");
do
{
printf("%c |",alfabeto[i]);
i++;
}while(alfabeto[i]!= '\0');
With NULL I get the following warning:
warning: comparison between pointer and integer [enabled by default] in C
But with '\0'
it compiles OK. I know which '\0'
is used for terminating char strings and NULL is used for comparison with pointers. But do they not have the same value?