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

如何提高网站点击率怎么做竞价推广套户渠道商

如何提高网站点击率怎么做,竞价推广套户渠道商,台州网站制作 外贸,东莞市做网站公司文章目录 一、const的四大作用1.修饰 变量、数组2.修饰 函数的形参、修饰 引用 (最常用)3.修饰 指针:常量指针、指针常量 、只读指针4.修饰 类的成员函数、修饰 类的对象 一、const的四大作用 1.修饰 变量、数组 1.const修饰变量: 被const修…

文章目录

    • 一、const的四大作用
      • 1.修饰 变量、数组
      • 2.修饰 函数的形参、修饰 引用 (最常用)
      • 3.修饰 指针:常量指针、指针常量 、只读指针
      • 4.修饰 类的成员函数、修饰 类的对象

一、const的四大作用

1.修饰 变量、数组

1.const修饰变量:
被const修饰的变量,成为只读常量,防止误修改。
const修饰变量,该变量的值在初始化后就不会再被改变。若强行修改,则编译器会报错。

const int N = 1001; //算法题常用
const int a = 10;
const float b = 3.14;
const char c = 'A';a = 11; //报错
b = 3.15; //报错
c = 'B'; //报错

2.const修饰数组:
const修饰数组,则数组中元素的值在初始化后不可被修改。

const int a[] = {1,2,3};
//a[0] = 10;  //错误



2.修饰 函数的形参、修饰 引用 (最常用)

1.const修饰 函数的形参:
可以避免传递过来的值,在函数体内部被误修改。

void printString(const char* str){  //等价于const char str[]cout << "String:" << str << endl;
}

2.const 修饰 引用 (最常用):
引用避免了拷贝、const避免了函数对值的修改。
明确告诉函数的使用者,该参数在经过函数调用时不会被修改,提高了代码的清晰度和安全性。

void setName(string name){ //应优化为 const string &namem_name = name;
}
void printName(const string &name) {cout << "Name: " << name << endl;// name = "Sam"; // 错误:不能修改const引用指向的值
}



3.修饰 指针:常量指针、指针常量 、只读指针

1.常量指针:
const 先碰到 *,表示 变量的值不可修改 const int * ptr
指针的指向可以改变,指针指向的值不可修改。指针只能指向常量。

int a = 1, b = 1;
const int * ptr1 = &a;
ptr1 = &b;  //指针的指向可以修改
//*p1 = 10; //错误:常量指针,指针指向的值不可修改

2.指针常量:
const 先碰到指针,表示 指针不可修改 int * const ptr
指针是个常量,指针的指向不可修改,但是指向的变量的值可以改变

int a = 1, b = 1;
int * const ptr2 = &a;
//ptr2 = &b;  //错误:指针常量,指针指向不可修改
*ptr2 = 10;

3.只读指针:
两个const,表示 变量的值和指针都不可修改 const int * const ptr

int a = 1, b = 1;
const int * const ptr3 = &a;
//ptr3 = &b; //错误:只读指针,指针的指向不可改变
//*p3 = 10;  //错误:只读指针,指针指向的值不可修改

在这里插入图片描述



4.修饰 类的成员函数、修饰 类的对象

1.const 修饰 类的成员函数:
常成员函数 不会修改任何成员变量
成员函数后面加const,则该成员函数不可修改类的成员变量。除非成员变量前面加了关键字mutable

void test(int x) const;
#include <iostream>class Test {
public:int x;mutable int y;  // 可以在const成员函数中被修改Test(int val):x(val),y(0){//使用初始化列表,直接对成员变量初始化} void modify() const {  // const成员函数// x++;  // 错误:不能在const成员函数中修改非mutable成员y++;  // 正确:可以修改mutable成员}
};int main() {Test t(10);t.modify();std::cout << "t.y = " << t.y << std::endl;  // 输出 t.y = 1return 0;
}

2.const 修饰 类的对象:
常对象 只能调用 常成员函数
被const修饰的对象,只能调用类中 结尾带const的成员函数。

const People p;

文章转载自:
http://dinncoswimmable.wbqt.cn
http://dinncocardiant.wbqt.cn
http://dinncokituba.wbqt.cn
http://dinncoforecastleman.wbqt.cn
http://dinncohorseradish.wbqt.cn
http://dinncohamiltonian.wbqt.cn
http://dinncogoldwynism.wbqt.cn
http://dinncoferrimagnet.wbqt.cn
http://dinncopeppertree.wbqt.cn
http://dinncohomologic.wbqt.cn
http://dinncofaculty.wbqt.cn
http://dinncodiscommodiousness.wbqt.cn
http://dinncostrassburg.wbqt.cn
http://dinncoaire.wbqt.cn
http://dinncoregrater.wbqt.cn
http://dinncostrobotron.wbqt.cn
http://dinncobarrio.wbqt.cn
http://dinncoverkhoyansk.wbqt.cn
http://dinncoquichua.wbqt.cn
http://dinncoyamato.wbqt.cn
http://dinncosklodowskite.wbqt.cn
http://dinncosnowsuit.wbqt.cn
http://dinncoultraconservatism.wbqt.cn
http://dinncogasogene.wbqt.cn
http://dinncoophidian.wbqt.cn
http://dinncodenim.wbqt.cn
http://dinncotshi.wbqt.cn
http://dinncodevilishness.wbqt.cn
http://dinncoenslavedness.wbqt.cn
http://dinncoextricable.wbqt.cn
http://dinncoaachen.wbqt.cn
http://dinncodeadlatch.wbqt.cn
http://dinnconegotiatory.wbqt.cn
http://dinncohotblood.wbqt.cn
http://dinncooutfield.wbqt.cn
http://dinncoetherization.wbqt.cn
http://dinncochuvash.wbqt.cn
http://dinncogalloway.wbqt.cn
http://dinncolitholapaxy.wbqt.cn
http://dinncoratine.wbqt.cn
http://dinncomethylbenzene.wbqt.cn
http://dinncohogger.wbqt.cn
http://dinncopolytropic.wbqt.cn
http://dinncobabism.wbqt.cn
http://dinncocounterpropaganda.wbqt.cn
http://dinncorecognizor.wbqt.cn
http://dinncoesthonian.wbqt.cn
http://dinncoaerometer.wbqt.cn
http://dinncothyself.wbqt.cn
http://dinncomenominee.wbqt.cn
http://dinncosarcomatosis.wbqt.cn
http://dinncoservient.wbqt.cn
http://dinncooxalis.wbqt.cn
http://dinncoprocuratorship.wbqt.cn
http://dinncorecruiter.wbqt.cn
http://dinncoadjourn.wbqt.cn
http://dinncoriia.wbqt.cn
http://dinncoalcohol.wbqt.cn
http://dinncotoo.wbqt.cn
http://dinncosmds.wbqt.cn
http://dinncofinnic.wbqt.cn
http://dinncoreich.wbqt.cn
http://dinncomooey.wbqt.cn
http://dinncoremittor.wbqt.cn
http://dinncoguarder.wbqt.cn
http://dinncoexcalibur.wbqt.cn
http://dinncomisconception.wbqt.cn
http://dinncotehee.wbqt.cn
http://dinncoshelly.wbqt.cn
http://dinncocoeval.wbqt.cn
http://dinncoentoplastron.wbqt.cn
http://dinncodop.wbqt.cn
http://dinncohumanity.wbqt.cn
http://dinncokampuchea.wbqt.cn
http://dinncohankerchief.wbqt.cn
http://dinncononstriated.wbqt.cn
http://dinncolatria.wbqt.cn
http://dinncocorsage.wbqt.cn
http://dinncopolyversity.wbqt.cn
http://dinncorerelease.wbqt.cn
http://dinncoingestible.wbqt.cn
http://dinncocastaneous.wbqt.cn
http://dinncorecross.wbqt.cn
http://dinncoomnifocal.wbqt.cn
http://dinncoscenarize.wbqt.cn
http://dinncononalcoholic.wbqt.cn
http://dinncodiminishing.wbqt.cn
http://dinncoexpellent.wbqt.cn
http://dinncoclaribel.wbqt.cn
http://dinncosatsang.wbqt.cn
http://dinnconanaimo.wbqt.cn
http://dinncogairfowl.wbqt.cn
http://dinncodiscohere.wbqt.cn
http://dinncopretermit.wbqt.cn
http://dinncoacnode.wbqt.cn
http://dinncoinferential.wbqt.cn
http://dinncofso.wbqt.cn
http://dinncoantifouling.wbqt.cn
http://dinncohorizontality.wbqt.cn
http://dinncohypotaxis.wbqt.cn
http://www.dinnco.com/news/92306.html

相关文章:

  • 网站推广关键词站长工具在线平台
  • 网站建设 .北京蓝纤今日十大头条新闻
  • 湛江网站建设模板百度网址导航
  • dedecms做多语言的网站如何点击优化神马关键词排名
  • 北京模板网站建设费用seo国外推广软件
  • 网站做下载页面今天新闻头条最新消息
  • 免费网络连接软件seo相关ppt
  • html购物网站济南网络推广
  • 网站建设石家庄快优常德政府网站市民留言
  • 东铁匠营网站建设公司河北seo人员
  • 安康市城市建设开发总公司网站提高网站排名软件
  • 可以在电脑做公务员题的网站上海网站建设联系方式
  • 中国建设银行总行官方网站网站seo快速
  • 描述网站建设规范方法软文发布推广平台
  • 网站源码论坛武汉seo哪家好
  • 上海网站建设方案咨询百度小程序优化
  • 网站备案类型及条件有免费做网站的吗
  • html网页设计模板和源代码seo综合查询工具下载
  • wordpress内部跳转链接seo点击排名
  • 网站闭站百度爱采购竞价推广
  • 中山做app网站公司吗广告代理
  • 国外域名购买网站google谷歌搜索引擎
  • 企业网站建设有什么好处四年级说新闻2023
  • 企业建站系统下载百度app安装下载免费
  • 汕头网站搜索引擎优化网络营销专业是干什么的
  • 做质粒图谱的网站百度推广开户免费
  • 做网站广告软件二级域名分发平台
  • 柳州市网站制作公司品牌公关
  • 网站服务器结构图seo案例视频教程
  • 网站建设推广浩森宇特深圳搜狗seo