typedef long (*GuiFunc) (int, int, int, unsigned short*, long, long);
Please help me understand the above line of code
typedef long (*GuiFunc) (int, int, int, unsigned short*, long, long);
Please help me understand the above line of code
you are defining a new type here.
The new type here is a function pointer.
the function pointer has 6 input arguments
You define a type GuiFunc
which is a pointer (that's that (*GuiFunc)
construct) to a function (the stuff in parentheses) which takes 3 ints
, a pointer to unsigned short
, two longs
and returns a long.
typedef long (*GuiFunc) (int, int, int, unsigned short*, long, long);
Defines new type GuiFunc
.that can declare a function pointer which takes 6 parameters int, int, int, unsigned short*, long, long
and returns long
.
Assume you have a function like this
long foo(int, int, int, unsigned short*, long, long)
{
}
if you declare
Guifunc callback; //declare a varaible of type Guifunc
callback=foo;
then you can call foo function like this long x=callback(6parameters);