Ask a Question

what is the use of 'generic pointer' in C++??

on 2012-03-05 12:10:34   by Prabir   on MCA  3 answers

Rajni

on 2012-03-05 10:30:00  

A "generic pointer" is not a specific term in programming C/C++ although it may, perhaps, be represented by a void *. A void * is a pointer to a memory location without actually specifying what data that location stores.

Rajni

on 2012-03-05 10:30:00  

When a variable is declared as being a pointer to type void it is known as a generic pointer. Since you cannot have a variable of type void, the pointer will not point to any data and therefore cannot be dereferenced. It is still a pointer though, to use it you just have to cast it to another kind of pointer first. Hence the term Generic pointer.

Prabir

on 2012-03-08 10:30:00  

thnx.... as generic pointer not specify any particular type.., can it be point any type of data like inf/float???