Originally Posted by
laserlight
That's initialisation, not assignment.
It's initialization and assignment, unless "=" is not an assignment operator (and yes it is)
If you don't specify any constant for initialisation, they are zero initialised, which for pointers means that they are initialised to be null pointers.
No, actually this is not true at all. Let me prove it:
Code:
#include<stdio.h>
int main()
{
int *value;
if(!value)
{
printf("it's a NULL pointer!\n");
}
else
{
puts("it's not a NULL pointer\n");
}
return 0;
}
Here's the output:
And that's the reason I posted this anyway: it seems that the pointer inside of the struct is NULL when I allocate memory for it.