typedef that consist function

K

kundasang

I know that
typedef unsigned short int USHORT; // make USHORT as unsigned int
type

what if
typedef void (*VPF)(int&,int&); // make ??
 
K

kundasang

I know that
typedef unsigned short int USHORT; // make USHORT as unsigned int
type

what if
typedef void (*VPF)(int&,int&); // make ??

ops suppose to make USHORT as unsigned short int
 
D

digz

ops suppose to make USHORT as unsigned short int

that makes VPF a function pointer type to a function which take two
ints( actually references, but the caller wont know ) and return a
void
 
J

Joel Yliluoma

Well, then it means that code such as this:

void test(USHORT& a, USHORT& b);
VPF testp = test;

is valid code but

void test(int& a, int& b);
VPF testp = test;

is not valid code. What exactly are you trying to ask?

If you wonder what the typedef does, here:

c++decl> explain void (*VPF)(int&,int&);
declare VPF as pointer to function (reference to int, reference to int) returning void

Substitute USHORT for int if needed.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,196
Messages
2,571,036
Members
47,631
Latest member
kukuh

Latest Threads

Top