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 8 of 13.

P.Ramya said:   1 decade ago
void means there is no meaning.so that we can assign (void*) is null pointer.

Makhan said:   1 decade ago
What is (void*)0?
what answer of that generated question?

Dilip Sharma said:   1 decade ago
(void*)0 means pointer to void i.e memory location are pointed and 0 denote that our pointer point to memory location which is 0 hence it will show Null pointer.

Vinod said:   1 decade ago
The syntax of NULL pointer is:
datatype *ptrname = NULL;
or
datatype *ptrname=(datatype*)0;

So, here the question is what is " (void*)0 "..?
by the above syntax we can say that (void*)0 is represents null pointer..

Rani said:   1 decade ago
What is the purpose of giving void. What does it actuay mean by the warning given as "function should return value"while program is excecuted without void?

Hitesh kumar said:   1 decade ago
(void*)0
like a null but not for all.

Abhishek Srivastava said:   1 decade ago
Its quite an interesting question!!

VOID POINTER points no specific datatype.
NULL POINTER is a pointer of any data type with a NULL value to it, i.e it currently holds to no memory reference.

Isha said:   1 decade ago
Can anyone explain me clearly what is void and null pointer with examples?

Uttam said:   1 decade ago
Void pointer or generic pointer is a pointer that can be pointed to any datatype.

Hence while declaration it doesn't point to any datatype
it is called as Null pointer.

eg.

main()
{
int *p;

void *vp;

vp=p;
}

Sisira said:   1 decade ago
int *p=null;
int *p=;
null pointer or zero pointer.
int *p=88989;//error


Post your comments here:

Your comments will be displayed after verification.