C Programming - Pointers - Discussion

Discussion Forum : Pointers - Yes / No Questions (Q.No. 3)
Is the NULL pointer same as an uninitialised pointer?
Answer: Option
No answer description is available. Let's discuss.
14 comments Page 1 of 2.

BCRT said:   8 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.

Kal said:   8 years ago
Uninitialized pointer results in the dangling pointer. So, both are different.

Nap said:   9 years ago
No, because pointers initially contains garbage values.

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.

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.

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.

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.

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.

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

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.

Post your comments here:

Your comments will be displayed after verification.