can anybody explain me the following code snippet.
typedef void * (*VP)(char*);
VP vp;
There is a tool under Linux (most unixes?) called cdecl, which is used
to explain or declare complex C and C++ types. I don't use it though
Using that tool with your declaration outputs
$ cdecl -+ explain 'void * (*VP)(char*);'
declare VP as pointer to function (pointer to char) returning
pointer to void
Having a typedef in your declaration changes the meaning of VP from
pointer to function to the alias of such a type.
We can use cdecl for the declaration of complex types. Using an example
from its man page:
$ cdecl -+ declare 'foo as pointer to member of class X function
(arg1, arg2) returning pointer to class Y'
class Y *(X::*foo)(arg1, arg2);
(Of course the 'class' keyword at the beginning is redundant in C++.)
Ali