C Programming - Pointers - Discussion
Discussion Forum : Pointers - Yes / No Questions (Q.No. 3)
3.
Is the NULL pointer same as an uninitialised pointer?
Discussion:
14 comments Page 1 of 2.
Akash kumar said:
1 decade ago
This is simple concept that the null pointer has the value of 0 while the unitialized pointer has the garbage value which pointing anywhere in the memory.
(3)
Nap said:
1 decade ago
No, because pointers initially contains garbage values.
(2)
Gazzye said:
2 decades ago
A Null pointer is one which holds 0 (zero) as its value and uninitialized pointer may have some garbage value. To check this out we can print the value of pointer.
Bhuvana said:
1 decade ago
Ya it will hold the garbage value.
A jain said:
1 decade ago
I agree with gazzye.
Harry said:
1 decade ago
NO, uninitialized pointer will not always be holding the garbage value. It will hold garbage value when it is declared locally and it will hold 0 value when it is declared locally.
Nikila said:
1 decade ago
UNINITIALIZED pointers are called as wild pointers which may cause a problem in execution. It is must to initialize the pointers.
MaDDy said:
1 decade ago
Unintialized pointer will be pointing to any garbage value
like int* p;
Initialized pointer will be pointing to a valid value in the memory
like int* p = &a; where a is an integer type containing some value
like int* p;
Initialized pointer will be pointing to a valid value in the memory
like int* p = &a; where a is an integer type containing some value
Ramya said:
1 decade ago
In pointers we didn't intialize the value we get the error.so we must intilaze the value.other wise we get the error.
Upendra.K said:
1 decade ago
A null pointer refers the zero value whereas the uninitialized value may refers to the garbage value depending on the declarations.
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers