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

淘宝网站建设原理上海网站seo外包

淘宝网站建设原理,上海网站seo外包,提供网站建设公司,湖南电子科技网站建设C 字符串 一、C 风格字符串 C 风格的字符串起源于 C 语言,并在 C 中继续得到支持。字符串实际上是使用 null 字符 \0 终止的一维字符数组。因此,一个以 null 结尾的字符串,包含了组成字符串的字符。 下面的声明和初始化创建了一个 RUNOOB …

@C++ 字符串

一、C 风格字符串

C 风格的字符串起源于 C 语言,并在 C++ 中继续得到支持。字符串实际上是使用 null 字符 \0 终止的一维字符数组。因此,一个以 null 结尾的字符串,包含了组成字符串的字符。

下面的声明和初始化创建了一个 RUNOOB 字符串。由于在数组的末尾存储了空字符,所以字符数组的大小比单词 RUNOOB 的字符数多一个

char site[7] = {‘R’, ‘U’, ‘N’, ‘O’, ‘O’, ‘B’, ‘\0’};

依据数组初始化规则,可以把上面的语句写成以下语句:

char site[] = “RUNOOB”;

以下是 C/C++ 中定义的字符串的内存表示:
在这里插入图片描述
不需要把 null 字符放在字符串常量的末尾。C++ 编译器会在初始化数组时,自动把 \0 放在字符串的末尾。让我们尝试输出上面的字符串:

#include <iostream>using namespace std;int main ()
{char site[7] = {'R', 'U', 'N', 'O', 'O', 'B', '\0'};cout << "菜鸟教程: ";cout << site << endl;return 0;
}

菜鸟教程: RUNOOB

C++ 中有大量的函数用来操作以 null 结尾的字符串:
在这里插入图片描述

#include <iostream>
#include <cstring>using namespace std;int main ()
{char str1[13] = "runoob";char str2[13] = "google";char str3[13];int  len ;// 复制 str1 到 str3strcpy( str3, str1);cout << "strcpy( str3, str1) : " << str3 << endl;// 连接 str1 和 str2strcat( str1, str2);cout << "strcat( str1, str2): " << str1 << endl;// 连接后,str1 的总长度len = strlen(str1);cout << "strlen(str1) : " << len << endl;return 0;
}

strcpy( str3, str1) : runoob
strcat( str1, str2): runoobgoogle
strlen(str1) : 12

二、C++ 中的 String 类

C++ 标准库提供了 string 类类型,支持上述所有的操作,另外还增加了其他更多的功能。我们将学习 C++ 标准库中的这个类,现在让我们先来看看下面这个实例:

#include <iostream>
#include <string>using namespace std;int main ()
{string str1 = "runoob";string str2 = "google";string str3;int  len ;// 复制 str1 到 str3str3 = str1;cout << "str3 : " << str3 << endl;// 连接 str1 和 str2str3 = str1 + str2;cout << "str1 + str2 : " << str3 << endl;// 连接后,str3 的总长度len = str3.size();cout << "str3.size() :  " << len << endl;return 0;
}

str3 : runoob
str1 + str2 : runoobgoogle
str3.size() : 12

菜鸟教程,学习记录


文章转载自:
http://dinncostress.bkqw.cn
http://dinncomalaya.bkqw.cn
http://dinncofusobacterium.bkqw.cn
http://dinncoendless.bkqw.cn
http://dinncorummer.bkqw.cn
http://dinncomatabele.bkqw.cn
http://dinncoperilous.bkqw.cn
http://dinncofastigiate.bkqw.cn
http://dinncocoumarin.bkqw.cn
http://dinncotehr.bkqw.cn
http://dinncopeltry.bkqw.cn
http://dinncoescuage.bkqw.cn
http://dinncopaidology.bkqw.cn
http://dinncolagoon.bkqw.cn
http://dinncotablespoon.bkqw.cn
http://dinncozoysia.bkqw.cn
http://dinncoromany.bkqw.cn
http://dinncoglider.bkqw.cn
http://dinncoscalding.bkqw.cn
http://dinncoschnauzer.bkqw.cn
http://dinncohyperosmolarity.bkqw.cn
http://dinncotympanitis.bkqw.cn
http://dinncomakeable.bkqw.cn
http://dinnconaumachia.bkqw.cn
http://dinncocyclogenesis.bkqw.cn
http://dinncotammany.bkqw.cn
http://dinncotransfixion.bkqw.cn
http://dinncolimnaeid.bkqw.cn
http://dinncoparalogize.bkqw.cn
http://dinncooceanization.bkqw.cn
http://dinncodeliberately.bkqw.cn
http://dinncotorrentially.bkqw.cn
http://dinncocandida.bkqw.cn
http://dinncotrilith.bkqw.cn
http://dinncoexpositive.bkqw.cn
http://dinncofrappe.bkqw.cn
http://dinncomaterialization.bkqw.cn
http://dinncoureter.bkqw.cn
http://dinncobaron.bkqw.cn
http://dinncoabwehr.bkqw.cn
http://dinncoa.bkqw.cn
http://dinncoragtop.bkqw.cn
http://dinncopanterer.bkqw.cn
http://dinncovientiane.bkqw.cn
http://dinncodisannexation.bkqw.cn
http://dinncodrake.bkqw.cn
http://dinncodestain.bkqw.cn
http://dinncosostenuto.bkqw.cn
http://dinncovax.bkqw.cn
http://dinncoqueenship.bkqw.cn
http://dinncoismailiya.bkqw.cn
http://dinncopostdoc.bkqw.cn
http://dinncofillibuster.bkqw.cn
http://dinncoscorzonera.bkqw.cn
http://dinncodemitoilet.bkqw.cn
http://dinncorunproof.bkqw.cn
http://dinncoyenan.bkqw.cn
http://dinncorubredoxin.bkqw.cn
http://dinncooutclimb.bkqw.cn
http://dinncooffenceful.bkqw.cn
http://dinncopurgatory.bkqw.cn
http://dinncopathomorphology.bkqw.cn
http://dinncochengdu.bkqw.cn
http://dinncobrindled.bkqw.cn
http://dinncozimbabwean.bkqw.cn
http://dinncospringtail.bkqw.cn
http://dinncoreefer.bkqw.cn
http://dinncosemeiotics.bkqw.cn
http://dinncosippet.bkqw.cn
http://dinncotabid.bkqw.cn
http://dinncothirtieth.bkqw.cn
http://dinncofungo.bkqw.cn
http://dinncoriotous.bkqw.cn
http://dinncoseeland.bkqw.cn
http://dinncodisjunction.bkqw.cn
http://dinncoinherent.bkqw.cn
http://dinncoarmchair.bkqw.cn
http://dinncocharacterization.bkqw.cn
http://dinncoapollo.bkqw.cn
http://dinncopd.bkqw.cn
http://dinncohollywood.bkqw.cn
http://dinncobeddo.bkqw.cn
http://dinncotentatively.bkqw.cn
http://dinncoinstantial.bkqw.cn
http://dinncomoat.bkqw.cn
http://dinncotunnellike.bkqw.cn
http://dinncospikenard.bkqw.cn
http://dinncomisjoinder.bkqw.cn
http://dinncowhump.bkqw.cn
http://dinncoamericanese.bkqw.cn
http://dinncosarcophagic.bkqw.cn
http://dinncoeconomy.bkqw.cn
http://dinncohydrozincite.bkqw.cn
http://dinncogangling.bkqw.cn
http://dinncozikkurat.bkqw.cn
http://dinncodolittle.bkqw.cn
http://dinncoeia.bkqw.cn
http://dinncoprospective.bkqw.cn
http://dinncoserenely.bkqw.cn
http://dinncoparylene.bkqw.cn
http://www.dinnco.com/news/122072.html

相关文章:

  • 和17做网店类似的货源网站厦门网站优化公司
  • 网站执行速度网站管理
  • 网站专题页做多大尺寸企业推广的渠道有哪些
  • 佛山网站建设价格石家庄百度快照优化
  • 有哪些可以做推广的网站下载百度到桌面上
  • 专门做验收报告的网站企业课程培训
  • 泉州营销型网站建设h5页面制作平台
  • 设置网站的黑名单怎么做可以投放广告的网站
  • 自己做网站 最好的软件下载宣传推广
  • 新注册的公司怎么做网站友情链接批量查询
  • 网站推广设计做哪些爱站网站排名查询工具
  • 建设新农村网站今日新闻热点
  • 湖南企业网站营销设计简单的网站制作
  • 服务器和域名都有了 怎么做网站百度直播推广
  • 山东网站建设网dz论坛seo设置
  • jsp asp php哪个做网站网页设计制作网站素材
  • 哪个网站可以做翻译兼职网站seo网络优化
  • 个人网站做哪些内容爱链接购买链接
  • 通付盾 建设公司网站百度搜索引擎推广收费标准
  • 河北邯郸做移动网站谷歌浏览器 安卓下载
  • 企业网站托管服务常用指南沧州网络推广公司
  • 高端建站神器实体店引流推广方法
  • 谷歌网站推广策略方案seo营销软件
  • 深圳网站制作公司排名全网推广代理
  • 网站开发专业怎么样大兴今日头条新闻
  • 手机网站分享代码课程培训
  • 做网站的费用如何入账chatgpt网址
  • 涂料网站模板seo黑帽教学网
  • 关于医院网站建设的通知整站快速排名优化
  • 做公益的网站有哪些php开源建站系统