C Programming - Pointers - Discussion
Discussion Forum : Pointers - General Questions (Q.No. 1)
1.
What is (void*)0?
Discussion:
124 comments Page 3 of 13.
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
MN SWARNA said:
1 decade ago
The 'void' keyword is represent no value but null pointer \0 or 0.
So () denotes the value * denotes address of memory location,
so (void*)0 is represent the NULL POINTER.
So () denotes the value * denotes address of memory location,
so (void*)0 is represent the NULL POINTER.
Dileep Gidwani said:
1 decade ago
As we know pointer doesn't have any return type, we write the keywords like int, float or char before * when we create a pointer. These keyword show that which type of value's or variable's address pointer will keep. And here we can see that we have used void before * that means pointer will not point any memory location. And we know that pointer which doesn't point any memory location is called null pointer.
Priti Dhingra said:
1 decade ago
It is null pointer which is indicating a memory having nothing in it or void memory. But as it is pointer, it will store the address.
Dinesh said:
1 decade ago
It refers null pointer. Because the return type void is mentioning the null (nothing). So it can be refered like this.
Prashant said:
1 decade ago
How we can use void pointer?
Abhay said:
1 decade ago
Pointers is I think the toughest topic I had ever came across about c. Can anybody please give some basics of pointer in simple language.
Sachin said:
1 decade ago
I think answer should be B, as void * shows that it is pointer to a data type, means it is a pointer to void data type, it will store the address of any data type.
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers