C Programming - Pointers - Discussion
Discussion Forum : Pointers - General Questions (Q.No. 1)
1.
What is (void*)0?
Discussion:
124 comments Page 12 of 13.
Neha reddy said:
8 years ago
I think parenthesis id preferred first wrt*. So the answer will be in C.
Divya goyal said:
8 years ago
We can't write * with an integer as *p means value at the address holded by p. So by putting *0 it never refer to any address. So answer is C only.
Vinston said:
8 years ago
What does that * mean after void?
Udaykiran said:
8 years ago
I can't understand this. Please explain.
Raj said:
8 years ago
(Void *)pointer is a pointer having no data type so it can't take implicitly data type we need to give data type explicitly.
Ie
(Void *)p
Need to give;
(int)*p
Or
(char) *p
(Void* ) have the flexibility to change the data type.
Ie
(Void *)p
Need to give;
(int)*p
Or
(char) *p
(Void* ) have the flexibility to change the data type.
Vidhi said:
7 years ago
void *ptr indicate void or generic pointer.
So (void *) is the address of pointer ptr.
So (void *) is the address of pointer ptr.
(1)
KHALIL Yhaia said:
7 years ago
It's a cast of 0 to (void *) '0' is a null value, so we got a NULL pointer.
Gerry said:
7 years ago
Very informative. Thanks.
(1)
Mayur 22kar said:
4 years ago
A void pointer is a pointer which nothing points anywhere In memory.
A null pointer means a pointer pointing to zero. In computer language, null value its just like initialize with zero.
A null pointer means a pointer pointing to zero. In computer language, null value its just like initialize with zero.
(11)
Swapnil Nimbalkar said:
2 years ago
Please explain it.
(3)
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers