???????????????
?????????ó?????????????????????????
#include <iostream>
#include <string>
using namespace std;
typedef void (*FP)(char* s);
void f1(char* s){cout<<s;}
void f2(char* s){cout<<s;}
void f3(char* s){cout<<s;}
int main(int argc??char* argv[])
{
void* a[]={f1??f2??f3};   //????????????飬????a???????????
a[0]("Hello World! "); //?????????????鯔?????±?????????ú???
FP f[]={f1??f2??f3};      //??????????????????飬?????f????????????
f[0]("Hello World! "); //?????????????????????±??????????к??????????
return 0;
}
???????????
??????1?????????????????????壬?????????????????????????????????????????????????????????????????????????????????????????У?????????????????????????????????????????????????????????????????????????????????????????????????????ν???????????????????????????????????????????????????
??????2?????Hello World????
????int main(int argc??char* argv[])
????{
????printf("Hello World! ");
????return 0;
????}
???????????????????????
//??????????
void PrintfText()
{
printf("Hello World! ");
}
//???????????????"???ú???"
void CallPrintfText(void (*callfuct)())
{
callfuct();
}
//??main???????????????
int main(int argc??char* argv[])
{
CallPrintfText(PrintfText);
return 0;
}
??????????ε????????
//??????λ??????
void PrintfText(char* s)
{
printf(s);
}
//?????????λ????????"???ú???"
void CallPrintfText(void (*callfuct)(char*)??char* s)
{
callfuct(s);
}
//??main???????????ε???????
int main(int argc??char* argv[])
{
CallPrintfText(PrintfText??"Hello World! ");
return 0;
}
??????????????????????????????μ????