C Programming - Pointers - Discussion

Discussion Forum : Pointers - General Questions (Q.No. 1)
1.
What is (void*)0?
Representation of NULL pointer
Representation of void pointer
Error
None of above
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
124 comments Page 13 of 13.

Shubham patra said:   2 years ago
Because it is not pointing to any memory address therefore it's a null pointer.

And we also avoid parenthesis.
(3)

Hossam Ahmed ALi said:   2 years ago
I think the right answer is B) Void pointer.

The void pointer can point to any variable of any data type or point to NULL which means points to no location in the memory.
(4)

Abhiram said:   12 months ago
It's a cast of 0 to (void *) '0' is a null value, so we got a NULL pointer.

void *ptr indicates void or generic pointer.

So (void *) is the address of pointer ptr.
(2)

Aman said:   7 months ago
(void*) converts the integer 0 into a void* pointer type.

The result is a null pointer of type void*


Post your comments here:

Your comments will be displayed after verification.