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 2 of 2.
Anshu Sharma said:
1 decade ago
A NULL pointer is always pointing to NOTHING and hold the "0" value and in case of Uninitialized pointer which may point to any GARBAGE value.
Pooja said:
1 decade ago
Because we take a space in memory so the option B is right it hold null value but the memory is allocated so.
Kal said:
9 years ago
Uninitialized pointer results in the dangling pointer. So, both are different.
BCRT said:
9 years ago
In my view, a uninitialised pointer is that which is not pointing to anywhere, and a null pointer is also same. Because while coding we get to a sometime situation when we don't want to initialise a pointer at beginning AND SO FOR THAT WE INITIALIZE IT WITH THE NULLVALUE. SO IN THE CASE OF UNINITIALISED ALSO.
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers