C++ Primer Plus 函数指针P201-P203深入探讨函数指针的源代码

C++ Primer Plus 函数指针P201-P203深入探讨函数指针的源代码,第1张

C++ Primer Plus 函数指针P201-P203深入探讨函数指针的源代码
#include 

using namespace std;
//等价的
const double* f1(const double arr[],int n);
const double* f2(const double*,int n);
const double* f3(const double[],int n);
int main()
{
    double arr[] {1112.3,1542.6,2227.9}; //C++ 11
    const double* (*p1) (const double arr[],int) = f1;
    auto p2 = f2;
    cout << "Using pointers to functions" < 

其实 auto pc=&pa;

就是相当于二维数组里的行指针

欢迎分享,转载请注明来源:内存溢出

原文地址: http://www.outofmemory.cn/zaji/5699499.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-17
下一篇 2022-12-17

发表评论

登录后才能评论

评论列表(0条)

保存