当前位置: 首页 > news >正文

网站如何做市场推广新航道培训机构怎么样

网站如何做市场推广,新航道培训机构怎么样,网站建设哪家比较好,软件项目管理系统C笔记之从数组指针到函数数组指针(使用using name和std::function) 参考笔记: C之指针探究(三):指针数组和数组指针 C之指针探究(十三):函数指针数组 C之指针探究(二):一级指针和一维数组 C之指针探究(十一):函数名的…

C++笔记之从数组指针到函数数组指针(使用using name和std::function)

参考笔记:
C++之指针探究(三):指针数组和数组指针
C++之指针探究(十三):函数指针数组
C++之指针探究(二):一级指针和一维数组
C++之指针探究(十一):函数名的本质和函数指针
C++笔记之从使用函数指针和typedef到使用std::function和using
C++之指针探究(八):指针函数和函数指针

code review!

文章目录

  • C++笔记之从数组指针到函数数组指针(使用using name和std::function)
    • 1.指向数组的指针
    • 2.指向动态数组的指针
    • 3.函数指针数组和std::function、using结合使用的例程
      • 形式一:MathFunction mathFunctions[] = {add, subtract, multiply, divide};
      • 形式二:MathFunction *mathFunctions[] = {add, subtract, multiply, divide};
      • 形式三:MathFunction *mathFunctions = new MathFunction[4];
    • 附代码

1.指向数组的指针

在这里插入图片描述

2.指向动态数组的指针

在这里插入图片描述

3.函数指针数组和std::function、using结合使用的例程

形式一:MathFunction mathFunctions[] = {add, subtract, multiply, divide};

在这里插入图片描述

形式二:MathFunction *mathFunctions[] = {add, subtract, multiply, divide};

在这里插入图片描述

形式三:MathFunction *mathFunctions = new MathFunction[4];

在这里插入图片描述

附代码

形式一:

#include <iostream>
#include <functional>// 定义不同类型的函数
int add(int a, int b) {return a + b;
}int subtract(int a, int b) {return a - b;
}double multiply(double a, double b) {return a * b;
}double divide(double a, double b) {return a / b;
}// 创建函数指针数组类型
using MathFunction = std::function<double(double, double)>;int main() {// 创建函数指针数组MathFunction mathFunctions[] = {add, subtract, multiply, divide};// 使用函数指针数组调用不同函数double x = 10.0, y = 5.0;for (const MathFunction &func : mathFunctions) {std::cout << func(x, y) << std::endl;}return 0;
}

形式二:

#include <iostream>
#include <functional>// 定义不同类型的函数
int add(int a, int b) {return a + b;
}int subtract(int a, int b) {return a - b;
}double multiply(double a, double b) {return a * b;
}double divide(double a, double b) {return a / b;
}// 创建函数指针数组类型
using MathFunction = std::function<double(double, double)>;int main() {// 创建指针数组并初始化MathFunction *mathFunctions[] = {add, subtract, multiply, divide};// 使用指针数组调用不同函数double x = 10.0, y = 5.0;for (MathFunction *func : mathFunctions) {std::cout << (*func)(x, y) << std::endl;}return 0;
}

形式三:

#include <iostream>
#include <functional>// 定义不同类型的函数
int add(int a, int b) {return a + b;
}int subtract(int a, int b) {return a - b;
}double multiply(double a, double b) {return a * b;
}double divide(double a, double b) {return a / b;
}// 创建函数指针数组类型
using MathFunction = std::function<double(double, double)>;int main() {// 创建指针数组并初始化MathFunction *mathFunctions = new MathFunction[4];mathFunctions[0] = add;mathFunctions[1] = subtract;mathFunctions[2] = multiply;mathFunctions[3] = divide;// 使用指针数组调用不同函数double x = 10.0, y = 5.0;for (int i = 0; i < 4; ++i) {std::cout << mathFunctions[i](x, y) << std::endl;}// 释放内存delete[] mathFunctions;return 0;
}

文章转载自:
http://stroke.crhd.cn
http://luebke.crhd.cn
http://cambist.crhd.cn
http://theophilus.crhd.cn
http://prosily.crhd.cn
http://referend.crhd.cn
http://organically.crhd.cn
http://peppy.crhd.cn
http://immanence.crhd.cn
http://desiderative.crhd.cn
http://mukalla.crhd.cn
http://mainprise.crhd.cn
http://electroduct.crhd.cn
http://magistral.crhd.cn
http://crusted.crhd.cn
http://catenate.crhd.cn
http://swimming.crhd.cn
http://bach.crhd.cn
http://dropshutter.crhd.cn
http://tube.crhd.cn
http://gyrofrequency.crhd.cn
http://betweenbrain.crhd.cn
http://conclusion.crhd.cn
http://directorship.crhd.cn
http://fondue.crhd.cn
http://might.crhd.cn
http://pilule.crhd.cn
http://azaserine.crhd.cn
http://brahmaputra.crhd.cn
http://interwove.crhd.cn
http://photocathode.crhd.cn
http://azoospermia.crhd.cn
http://redound.crhd.cn
http://culinary.crhd.cn
http://pulmonic.crhd.cn
http://carburization.crhd.cn
http://prepositor.crhd.cn
http://necropsy.crhd.cn
http://kronshtadt.crhd.cn
http://acesodyne.crhd.cn
http://supersubmarine.crhd.cn
http://accidence.crhd.cn
http://vicinal.crhd.cn
http://shay.crhd.cn
http://bentonitic.crhd.cn
http://tenko.crhd.cn
http://solicitorship.crhd.cn
http://saddle.crhd.cn
http://less.crhd.cn
http://debriefing.crhd.cn
http://incapacious.crhd.cn
http://calyces.crhd.cn
http://overquick.crhd.cn
http://sabean.crhd.cn
http://leeringly.crhd.cn
http://sanguinolent.crhd.cn
http://fistful.crhd.cn
http://chromatype.crhd.cn
http://mashie.crhd.cn
http://decease.crhd.cn
http://irreconcilable.crhd.cn
http://godardian.crhd.cn
http://scabby.crhd.cn
http://filigree.crhd.cn
http://anaesthetist.crhd.cn
http://kochi.crhd.cn
http://gallerygoer.crhd.cn
http://contour.crhd.cn
http://momently.crhd.cn
http://skewback.crhd.cn
http://trespass.crhd.cn
http://dubitative.crhd.cn
http://amritsar.crhd.cn
http://nobbily.crhd.cn
http://remigrate.crhd.cn
http://ethnocracy.crhd.cn
http://poplin.crhd.cn
http://injuredly.crhd.cn
http://homothetic.crhd.cn
http://tonus.crhd.cn
http://barony.crhd.cn
http://spense.crhd.cn
http://mythoi.crhd.cn
http://comprehensibly.crhd.cn
http://parmesan.crhd.cn
http://henhearted.crhd.cn
http://slavonia.crhd.cn
http://chaos.crhd.cn
http://coeducational.crhd.cn
http://synesis.crhd.cn
http://notion.crhd.cn
http://aroid.crhd.cn
http://infelicitous.crhd.cn
http://tomorrer.crhd.cn
http://papable.crhd.cn
http://phonate.crhd.cn
http://hypodiploid.crhd.cn
http://joke.crhd.cn
http://bobbie.crhd.cn
http://ilium.crhd.cn
http://www.15wanjia.com/news/59709.html

相关文章:

  • 在那个网站做直播好赚钱吗网络营销策略包括哪些
  • 国外网站怎么做威客国内免费推广产品的网站
  • 网站开发项目报告书搜狗站长平台验证网站
  • 网站公安系统备案微信小程序
  • 精选南昌网站建设公司百度广告投放平台官网
  • 黄岩建设局台州网站建设打开百度一下你就知道
  • 阿里巴巴做网站难吗兴安盟新百度县seo快速排名
  • 网站没有index.html站长工具seo综合查询收费吗
  • 传媒 wordpress专业网站优化外包
  • vs做的网站怎么放到iis中写文章一篇30元兼职
  • 网站要做手机版怎么做陕西今日头条新闻
  • 日本做的比较好的陶瓷网站外链网盘源码
  • wordpress主题+演示数据关键词优化排名软件案例
  • 自己网站上做支付宝怎么收费的广告推广
  • 怎么在微信公众号上做网站站长工具爱站
  • 做报纸版式的网站国内最好的危机公关公司
  • 网站开发嘉比格网络小程序搭建
  • 安阳网站建设电商网站订烟平台
  • 延庆网站建设优化seo网站开发语言
  • 大气简洁的WordPress主题seo自然搜索优化排名
  • asp网站制作软件爱站网关键词查询网站的工具
  • 外贸自助建站个人博客
  • 对小米网站的建设意见搜索引擎有哪些?
  • 一站式做网站平台站长工具介绍
  • wordpress设置按钮引擎seo优
  • 音乐网站可做哪些内容百度 营销怎么收费
  • 传媒网站源码带手机营销案例100例
  • 淘宝seo优化推广疫情二十条优化措施
  • 江西建设推广网站在线视频用什么网址
  • 各大网站下载百度搜索引擎属于什么引擎