NULL Pointer Bugs
A NULL character pointer is NOT the same as a pointer to a NULL string. In Solaris, the following program will lead to a "Segmentation Fault".
- #include <stdio.h>
- #include <string.h>
- int main()
- char *string=NULL;
- printf("/n String length=%d",strlen(string));
- return 0;
I don't know hwy this happens clearly now, and it should be pay more attention.