I understand that the definition of a string in C is that the string has to have NUL character at the end. I am also aware that the following statements creates NUL character of a string:
str[4] = 0;
str[4] = '\0';
However, when you use this statement
str[4] = NULL;
I am getting this message:
string1.c:15:12: warning: assignment makes integer from pointer
without a cast [enabled by default]
My understanding of NULL is that it is a macro with the definition of ((void *)0). Now why is this assignment causing this warning message? What this warning message really mean? Can someone translate this message so that it is easier to understand?