2012-06-18 21:27:32 +04:00
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
int fred(int p)
|
|
|
|
{
|
|
|
|
printf("yo %d\n", p);
|
|
|
|
return 42;
|
|
|
|
}
|
|
|
|
|
|
|
|
int (*f)(int) = &fred;
|
|
|
|
|
2016-12-18 07:18:19 +03:00
|
|
|
/* To test what this is supposed to test the destination function
|
|
|
|
(fprint here) must not be called directly anywhere in the test. */
|
|
|
|
int (*fprintfptr)(FILE *, const char *, ...) = &fprintf;
|
|
|
|
|
2012-06-18 21:27:32 +04:00
|
|
|
int main()
|
|
|
|
{
|
2016-12-18 07:18:19 +03:00
|
|
|
fprintfptr(stdout, "%d\n", (*f)(24));
|
2012-06-18 21:27:32 +04:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/
|