0
can someone tell me what the hell is NULL
5 Antworten
+ 2
'null' is a reference parameter which represents value 'zero' and which doesn't refer to any object.
There is no representation for 'null' in memory.
In simple word's, 'null is empty'.
+ 2
what swagat wrote.
Consider NULL to be absolutely nothing you can work with
+ 1
Null is basically a constant with zero value
+ 1
suppose u have something like...
int *p; // not initialized ie wild pointer
as by default it will be auto storage class the did fault value will be some garbage value.
The garbage here refers to some value which can be pointing to some thing. Dereferencing the value without initialization may throw some exception or can cause some serious issues if it finds the garbage value to be valid address in user space while editing the value. in system space it will violate the permission and get exception.
so to avoid such we use the special pointer as NULL pointer which points to nothing and is considered to be void *0
0
Thank you ..