What is the difference between null pointer and the void
pointer?

Answers were Sorted based on User's Feedback



What is the difference between null pointer and the void pointer?..

Answer / vignesh1988i

NULL POINTER:
this pointer returns null value to the main function......
it cant be type casted.........

VOID POINTER:
this pointer has a special advantages that it can point
to any value (int , char, float etc) when its type casted

for eg:
main()
{
char *p;
int n;
(int *)p=&n;
so on the above character pointer is been type casted to
point an integer value n;

Is This Answer Correct ?    11 Yes 3 No

What is the difference between null pointer and the void pointer?..

Answer / sunitha

null pointer : used to compair a pointer to any object or
a function and returns a null value to the main function.

void pointer : void pointer ia pointer which does not have
any return type and it can be easily type casted with other
type of pointers.

Is This Answer Correct ?    1 Yes 0 No

What is the difference between null pointer and the void pointer?..

Answer / vaibhav

null pointer contain null value . it doesn't contain any
value.
while void pointer is a pointer that cascade at a runtime.
i.e it casting at runtime

Is This Answer Correct ?    3 Yes 3 No

Post New Answer

More C Interview Questions

Go through this linked list concept.While traversing through the singly linked list sometimes the following code snippet "while(head != NULL)" is used and other times "while(head->link != NULL)"is used(Here head is the pointer pointing to the first node,node has two parts data part and link part).What is the difference between head != NULL and Head->link != NULL and in which situation are they used?

1 Answers   Oracle,


List some basic data types in c?

0 Answers  


main() { printf(5+"good morning"); printf("%c","abcdefgh"[4]); }the o/p is morning and e...how someone explain

1 Answers  


Write a program to compute the following 1!+2!+...n!

4 Answers  


What is an expression?

0 Answers  






What's the total generic pointer type?

0 Answers  


What is a program flowchart and explain how does it help in writing a program?

0 Answers  


What are header files and what are its uses in C programming?

0 Answers  


What is variable declaration and definition in c?

0 Answers  


Why is extern used in c?

0 Answers  


How can I read a directory in a C program?

2 Answers   Bright Outdoor, Wipro,


When should a type cast not be used?

0 Answers  


Categories