I guess this have been answered before, but I just couldn't find the answer here or on Google, but I think that it is because I couldn't type the right question...
Can someone please explain why aren't pointers initialized to NULL?
Example:
void test(){
char *buf;
if (!buf)
// whatever
}
The program wouldn't step inside the if because buf
is not null.
I would like to know why, in what case do we need a variable with trash on, specially pointers addressing to trash on the memory?