C++中指向函数指针的指针数组

#include<iostream>


int c(int a, int c){ return a + c; }


void main(){
int(*p)(int, int)=c;//指向函数的指针
decltype(p) *dd=&p;//指向函数指针的指针
auto *pp = &p;//这个还是指向函数指针的执政
decltype(p) **shuzu = new decltype(p)*[100];//指向函数指针的指针数组
shuzu[0] = &p;//指针的初始化


std::cout << (*p)(1, 2) << std::endl;
std::cin.get();
}

猜你喜欢

转载自blog.csdn.net/qq_37353105/article/details/78436664