it's really ridiculous when I try to test my code today
I had never known there are some key word or syntax about "nil" in C/C++, to make it clear I duplicate it in the following test code:
/* nil.c by vinco at 2011-08-03
* os : ubuntu 9.10
* compiler :CC/GCC
*/
#include<stdio.h>
int main()
{
char* p = NULL;
printf("\n");
printf("p = %p\n",p);
printf("p = %s\n",p);
printf("\n");
return 0;
}
compile and run it:
root@vinco:/home/vinco# make nil
cc nil.c -o nil
root@vinco:/home/vinco# ./nil
p = (nil)
p = (null)
root@vinco:/home/vinco#
I search it in Google and Baidu, it's seem that "nil" is same with NULL to some extent , means no value.
does that the truth ?
I would appreciate it if you could explain it clearly for me !!!