NULL Pointer Bugs
A NULL character pointer isNOTthe 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>
- intmain()
- {
- char*string=NULL;
- printf("/nStringlength=%d",strlen(string));
- return0;
- }
I don't know hwy this happens clearly now, and it should be pay more attention.