This commit is contained in:
Ingy döt Net 2013-04-10 21:29:02 -07:00
parent 764da6cbbb
commit db842d013d
19005 changed files with 197040 additions and 7 deletions

View file

@ -0,0 +1,9 @@
void myFuncSimple( void (*funcParameter)(void) )
{
/* ... */
(*funcParameter)(); /* Call the passed function. */
funcParameter(); /* Same as above with slight different syntax. */
/* ... */
}

View file

@ -0,0 +1,5 @@
void funcToBePassed(void);
/* ... */
myFuncSimple(&funcToBePassed);

View file

@ -0,0 +1,13 @@
int* myFuncComplex( double* (*funcParameter)(long* parameter) )
{
long inLong;
double* outDouble;
long *inLong2 = &inLong;
/* ... */
outDouble = (*funcParameter)(&inLong); /* Call the passed function and store returned pointer. */
outDouble = funcParameter(inLong2); /* Same as above with slight different syntax. */
/* ... */
}

View file

@ -0,0 +1,7 @@
double* funcToBePassed(long* parameter);
/* ... */
int* outInt;
outInt = myFuncComplex(&funcToBePassed);

View file

@ -0,0 +1,5 @@
int* (*funcPointer)( double* (*funcParameter)(long* parameter) );
/* ... */
funcPointer = &myFuncComplex;