函数指针和new初始化

 1 #include <iostream>
 2 using namespace std;
 3 
 4 void show(int a);
 5 int main(int argc, char *argv[])
 6 {
 7     void (* pfunc)(int a) = NULL;
 8     pfunc = show;
 9     pfunc(886);
10     return 0;
11 }
12 
13 void show(int a)
14 {
15     int b = new int(a);
16     cout << b;
17 }

一个简单的小程序,显示函数指针的用法,以及new初始化。

原文地址:https://www.cnblogs.com/autumoonchina/p/3563738.html