#include
typedef void ( *callback_fun )( void );
void fun1( void )
{
printf( "fun1/r/n" );
}
void fun2( void )
{
printf( "fun2/r/n" );
}
int main(int argc, char* argv[])
{
unsigned long addr;
callback_fun fun;
printf( "合法的函数地址为%d %d/r/n", ( int )fun1, ( int )fun2 );
printf( "请输入上面两个中的某一个/r/n" );
scanf( "%u", &addr );
fun = ( callback_fun )addr;
fun();
return 0;
}
typedef void ( *callback_fun )( void );
void fun1( void )
{
printf( "fun1/r/n" );
}
void fun2( void )
{
printf( "fun2/r/n" );
}
int main(int argc, char* argv[])
{
unsigned long addr;
callback_fun fun;
printf( "合法的函数地址为%d %d/r/n", ( int )fun1, ( int )fun2 );
printf( "请输入上面两个中的某一个/r/n" );
scanf( "%u", &addr );
fun = ( callback_fun )addr;
fun();
return 0;
}