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

wordpress增加搜索框长沙seo推广营销

wordpress增加搜索框,长沙seo推广营销,seo教学平台,wordpress 商用授权3.1 函数默认参数 本节内容之前已经整理过,详见22.函数的默认值 3.2 函数占位参数 C中函数的形参列表里可以有占位参数,用来做占位,调用函数时必须补填该位置 语法: 返回值类型 函数名 (数据类型) {} 在现阶段函数的占位参数…

3.1 函数默认参数

本节内容之前已经整理过,详见22.函数的默认值

3.2 函数占位参数

C++中函数的形参列表里可以有占位参数,用来做占位,调用函数时必须补填该位置

语法
返回值类型 函数名 (数据类型) {}

在现阶段函数的占位参数存在意义不大,但是后面的课程中会用到该技术

示例:

#include <iostream>
using namespace std;// 函数占位参数,占位参数也可以有默认值
void func(int a, int) {cout  << "this is a func" << endl;
}int main() {func(1, 2);return 0;
}

3.3 函数重载-基本语法

作用:函数名可以相同,提高复用性
函数重载满足条件

  • 同一个作用域
  • 函数名相同
  • 函数参数类型不同或者个数不同或者顺序不同

注意:函数的返回值不可以作为函数重载的条件

示例:

#include <iostream>
#include <iostream>
using namespace std;// 1.参数类型不同
void print(int a)
{cout << "int" << endl;
}
void print(double a)
{cout << "double" << endl;
}// 2.参数顺序不同
void print(double a, int b) {cout << "int int" << endl;
}
void print(int a, double b) {cout << "double double" << endl;
}
// 注意:同类型参数顺序不同是不被允许的,因为函数名相同,编译器会认为这是同一个函数
// void print(int a, int b) {}和void print(int b, int a) {}同时出现时,编译器会报错// 3。参数个数不同
void print(int a, int b, int c) {cout << "int int int" << endl;
}
void print(int a, int b,  int c, int d) {cout << "int int" << endl;
}// 注意事项:函数返回值类型不同不可作为函数重载的条件
int main()
{print(1);print(1.0);print(1.0, 1);print(1, 1.0);print(1, 1, 1);print(1, 1, 1, 1);return 0;
}

3.4 函数重载-注意事项

  • 引用作为重载条件
  • 函数重载碰到函数默认参数

示例:

#include <iostream>
using namespace std;// 函数重载注意事项
// 1.引用作为重载的条件
void fun(int& a) {cout << "func(int& a)调用" << endl;
}void fun(const int& a) {cout << "func(const int& a)调用" << endl;
}// 2.函数重载碰到默认参数
void func(int a) {cout << "func(int a)调用" << endl;
}
void func(int a, int b = 10) {cout << "func(int a, int b = 10)调用" << endl;
}int main() {// func(int& a)调用int a = 10;fun(a);// func(const int& a)调用const int b = 10;fun(b);fun(10);// 当函数调用碰到默认参数会出现二义性报错// func(10);   // 错误❌,默认参数不能省略func(10,10);    //  正确return 0;
}

文章转载自:

http://Beb5lSn1.smdnL.cn
http://27rT6ltl.smdnL.cn
http://gsin2j8M.smdnL.cn
http://TOmdov3a.smdnL.cn
http://9qafMiQT.smdnL.cn
http://pTh1w8dv.smdnL.cn
http://rvabiJfu.smdnL.cn
http://WEl6P4iA.smdnL.cn
http://jyvt3B2g.smdnL.cn
http://Naq9E9Fw.smdnL.cn
http://DMjwoLhU.smdnL.cn
http://eQ1QiPMj.smdnL.cn
http://tJZRuYvB.smdnL.cn
http://3WYNkwLy.smdnL.cn
http://Cvt2pPHF.smdnL.cn
http://Oakakzv6.smdnL.cn
http://xk6F32bo.smdnL.cn
http://Q7aOdGmM.smdnL.cn
http://cjY0QmMV.smdnL.cn
http://NeeXqIUr.smdnL.cn
http://iURzjgfo.smdnL.cn
http://P51d1WrU.smdnL.cn
http://QUswtrZq.smdnL.cn
http://oH1CfMAM.smdnL.cn
http://roRinSOh.smdnL.cn
http://3R2aNUFD.smdnL.cn
http://t53OfO8V.smdnL.cn
http://gI8WGqcX.smdnL.cn
http://HeRyNN6p.smdnL.cn
http://DoP8jq4D.smdnL.cn
http://www.dtcms.com/wzjs/660681.html

相关文章:

  • 哪个网站有激光打标业务做wordpress md
  • 门户网站开发技术北京大兴网站建设公司咨询
  • asp网站会员管理模板手机网站移动应用
  • 做平面设计必看的网站建设网站免费模板下载
  • DW网站建设出现哪些问题wordpress对接小程序
  • 好的建筑设计网站广州网站建设设计公司
  • 网站建设大全四川监理协会建设网站
  • 吉林电商网站建设公司哪家好移动端网站建设重点有哪些
  • 宜春网站设计公司网站开发的公司属于什么行业
  • 网站界面设计实训总结商标设计费用一般是多少
  • 建设公司的网站天津网站建设公司电扬
  • 网站开发验收确认书google搜索引擎入口2022
  • 公司网站代码湖南兼职网站建设
  • 温岭市住房和城乡建设局网站建企业网站教程
  • 南昌网站建设服务html网页设计期末大作业
  • 男朋友抱着我在教室做网站响应式企业网站设计与实现
  • 制作完整网站需要掌握哪些知识手机兼职的正规平台有哪些
  • seo网站推广有哪些音乐制作网站
  • h5免费制作网站有哪些室内展厅设计公司
  • 做滋补品销售有什么网站成都电脑培训班零基础
  • 中国贸易网是什么网站淘宝网络营销方案
  • 网站开发涉及内容如何免费创建自己的平台
  • 苏州模板建站平台广告宣传页怎么制作
  • 社区网站建设方案ppt创建网站的流程有哪些
  • 机票网站建设公司好公司部门解散调岗不同意有赔偿吗
  • 沈阳住房建设局网站哪些企业需要网络推广
  • 加快政务公开网站建设做网站对外贸有什么用
  • 垂直网站建设的关键因素网站建设公司软jian湖南岚鸿
  • 免费做网站页头图做引流去那些网站好
  • 给个营销型网站齐齐哈尔市住房城乡建设门户网站