Lets say we have an array of char pointers
char* array[] = { "abc", "def" };
Now what should be put in the end ?
char* array[] = { "abc", "def", '\0' };
or
char* array[] = { "abc", "def", "\0" };
Though, both works. We only have to put the condition to check the end accordingly
like
array[ index ] != '\0';
or
array[ index ] != "\0";
My question is which one is the better way? Which is used by most programmers?
Edit
Most answers say that NULL is better than '\0' and "\0". But I always thought that
NULL is same as '\0' which is same as 0x0 or 0
Is it wrong?