Wednesday

void pointer


Define void pointer.

A void pointer is pointer which has no specified data type. The keyword ‘void’ is preceded the pointer variable, because the data type is not specific. It is also known as a generic pointer. The void pointer can be pointed to any type. If needed, the type can be casted.
Ex: float *float_pointer;
int *int_pointer;
void *void_pointer;
. . . . . . . .
. . . . . . . .
void_pointer = float_pointer;
. . . . . . . .
. . . . . . . .
void_pointer = int_pointer;
A void pointer is generally used as function parameters, when the parameter or return type is unknown.   

Kindly Bookmark this Post using your favorite Bookmarking service:
Technorati Digg This Stumble Stumble Facebook Twitter
YOUR ADSENSE CODE GOES HERE

0 comments:

Post a Comment

Dont Forget for Commets

 

| C programing tutorials © 2009. All Rights Reserved | Template Style by My Blogger Tricks .com | Design by Brian Gardner | Back To Top |