Re: Question about 'C' code and use of "void"

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance




"John Carson" <jcarson_n_o_sp_am_@xxxxxxxxxxxxxxx> wrote in message
news:OL8dCQ6hGHA.4712@xxxxxxxxxxxxxxxxxxxxxxx
It works for function pointers to. Thus

void (*fnptr)(int);

declares a variable called fnptr that is a pointer to a function that
takes an int argument and returns void, whereas

typedef void (*fnptr)(int);

declares a typename called fnptr that is an alias for the type of a
pointer to a function that takes an int argument and returns void.


A typedef can also be used to define a function (not function pointer) type.
Such a typedef can be used to declare (though not define) non-member AND
member functions. You will still need to start the function body definition
without typedef.


.



Relevant Pages