C Programming - Pointers - Discussion
Discussion Forum : Pointers - General Questions (Q.No. 1)
1.
What is (void*)0?
Discussion:
124 comments Page 3 of 13.
Dinesh said:
1 decade ago
The Syntax for function definition is
return type function name(data type variable name)
but here the data type is given and the variable name is not given
and there is no return type.so,it is a null pointer.a void pointer is a pointer with return type void.
return type function name(data type variable name)
but here the data type is given and the variable name is not given
and there is no return type.so,it is a null pointer.a void pointer is a pointer with return type void.
Afsheen said:
1 decade ago
What is '0' representing here?
Farz said:
1 decade ago
What for this '0' used?
Nishu said:
1 decade ago
void(*) measns void pointer,it means value is nt given or void..
but void(*0)means it point to null value(i.e 0)..therefore null pointer
but void(*0)means it point to null value(i.e 0)..therefore null pointer
Prathi said:
1 decade ago
Here it s given that void(*)0. Is there any diff betwn void(*0) and void (*)0?.
Bharathi said:
1 decade ago
Are you sure about this answer, sorry take it as negative I have bit doubt on this.
Ras said:
1 decade ago
I think it is void pointer but it is not void so explain it.
Vinayak said:
1 decade ago
I think, since the representation of void with no parameter is (void).if we represent it in the form of (void*)0=>a pointer pointing to a location which is already been deallocated by using free() deallocation function.so it points to a location which has nothing i.e null.Hence it is rightly called as null pointer.
Velmurugan said:
1 decade ago
I think NULL pointer and void pointer are entirely different and so NULL pointer can't be represented through void pointer.
Kanjit said:
1 decade ago
The (void *) I understand as meaning a pointer to a void, so
>
> (void *) 0
>
> would be a void pointer to zero
so it will be null pointer
>
> (void *) 0
>
> would be a void pointer to zero
so it will be null pointer
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers