[{"createTime":1735734952000,"id":1,"img":"hwy_ms_500_252.jpeg","link":"https://activity.huaweicloud.com/cps.html?fromacct=261f35b6-af54-4511-a2ca-910fa15905d1&utm_source=V1g3MDY4NTY=&utm_medium=cps&utm_campaign=201905","name":"华为云秒杀","status":9,"txt":"华为云38元秒杀","type":1,"updateTime":1735747411000,"userId":3},{"createTime":1736173885000,"id":2,"img":"txy_480_300.png","link":"https://cloud.tencent.com/act/cps/redirect?redirect=1077&cps_key=edb15096bfff75effaaa8c8bb66138bd&from=console","name":"腾讯云秒杀","status":9,"txt":"腾讯云限量秒杀","type":1,"updateTime":1736173885000,"userId":3},{"createTime":1736177492000,"id":3,"img":"aly_251_140.png","link":"https://www.aliyun.com/minisite/goods?userCode=pwp8kmv3","memo":"","name":"阿里云","status":9,"txt":"阿里云2折起","type":1,"updateTime":1736177492000,"userId":3},{"createTime":1735660800000,"id":4,"img":"vultr_560_300.png","link":"https://www.vultr.com/?ref=9603742-8H","name":"Vultr","status":9,"txt":"Vultr送$100","type":1,"updateTime":1735660800000,"userId":3},{"createTime":1735660800000,"id":5,"img":"jdy_663_320.jpg","link":"https://3.cn/2ay1-e5t","name":"京东云","status":9,"txt":"京东云特惠专区","type":1,"updateTime":1735660800000,"userId":3},{"createTime":1735660800000,"id":6,"img":"new_ads.png","link":"https://www.iodraw.com/ads","name":"发布广告","status":9,"txt":"发布广告","type":1,"updateTime":1735660800000,"userId":3},{"createTime":1735660800000,"id":7,"img":"yun_910_50.png","link":"https://activity.huaweicloud.com/discount_area_v5/index.html?fromacct=261f35b6-af54-4511-a2ca-910fa15905d1&utm_source=aXhpYW95YW5nOA===&utm_medium=cps&utm_campaign=201905","name":"底部","status":9,"txt":"高性能云服务器2折起","type":2,"updateTime":1735660800000,"userId":3}]
<>下面字符串的长度为
<>考点:转义字符
<>转义字符的意义:
我们使用的字符串都是用 “ ” 双引号框起来的,电脑只识别双引号内框起来的内容:
printf(" ");
但是如果想表达的字符是 “ “abc” ”,即如下
printf(" "abc" ");
运行结果:报错
电脑是识别不出来具体哪段是我们想输出的字符串,所以我们用反斜杠 \ 来区分这些让电脑容易误会的字符,想表达 “ “abc” ”,正确的表述是:
printf(" \"abc\" ");
反斜杠 \ 就是转义字符,反斜杠后的字符代表的是我要输出这个字符
输出效果
<>转义字符表
<>再看
去掉表示字符串的首尾的双引号:
* \ \ :第一个 \ 是转义字符 ,第二个 \ 被第一个斜杠转义,变成我们要输出的对象,即 \ 是代表输出一个 \ ,\的字符应该是1
* \ " :第一个 \ 是转义字符 ,第二个 " 被第一个斜杠转义,\ " 代表我们要输出 " ,即字符1
* BBB:就是输出BBB,即3个字符
* \123:第一个 \ 是转义字符
,123是被转义的对象,参考如下,电脑把123当作八进制数,输出该八进制数代表的字符,所以\123也是输出一个字符,即1个字符
* \Xbb:查到的资料显示,转义字符后根大写字母,就是表达本身,即输出Xbb,所以3个字符
* \t:\t是特定符号制表符,代表1个字符
综上:1+1+3+1+3+1=10,所以长度为10。