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

List some of the static data structures in C?

0 Answers  


I have a function which accepts, and is supposed to initialize,a pointer, but the pointer in the caller remains unchanged.

1 Answers  


What does c value mean?

0 Answers  


What is NULL pointer?

0 Answers   Infosys,


How to implement a packet in C

0 Answers   Aricent,






1234554321 1234 4321 123 321 12 21 1 1 12 21 123 321 1234 4321 1234554321

0 Answers  


How do you use a 'Local Block'?

0 Answers   Ericsson,


What is this pointer in c plus plus?

0 Answers  


compute the nth mumber in the fibonacci sequence?

10 Answers   Canon, HPL, Satyam, TCS,


what is difference between procedural language and functional language ?

4 Answers   Wipro,


int x=sizeof(!5.856); What will value of variable x?

2 Answers  


Describe newline escape sequence with a sample program?

0 Answers  


Categories