博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
c语言中双引号和单引号_C中的双引号与单引号
阅读量:2506 次
发布时间:2019-05-11

本文共 980 字,大约阅读时间需要 3 分钟。

c语言中双引号和单引号

In you might find yourself using double quotes in some cases, and single quotes in other cases.

在您可能发现自己在某些情况下使用双引号,而在其他情况下使用单引号。

In some languages, there’s no difference between the two. But in C, there is difference, and you’ll use one vs the other depending on the need.

在某些语言中,两者之间没有区别。 但是在C语言中,存在差异,您将根据需要使用一个与另一个。

When can you use single quotes and when can you use double quotes?

什么时候可以使用单引号,什么时候可以使用双引号?

Single quotes are used to identify a single character (char value):

单引号用于标识单个字符( char值):

char letter = 'a';

Double quotes are used to create a string literal:

双引号用于创建字符串文字:

char *name = "Flavio";

Note that you can create a single-letter string literal:

请注意,您可以创建一个单字母字符串文字:

char *letter = "a";

But remember that a string is composed by the characters of the string, plus a 0 character at the end, which makes single-letter string literals take double the space of a single character.

但是请记住,字符串是由字符串的字符组成的,最后是一个0字符,这使得单字母字符串文字占用的空间是单个字符的两倍。

翻译自:

c语言中双引号和单引号

转载地址:http://aomgb.baihongyu.com/

你可能感兴趣的文章
增量关联规则挖掘—FUP算法
查看>>
spring相关—AOP编程—切入点、连接点
查看>>
animation_Frame动画图片轮播
查看>>
BZOJ 4195 - 离散化 + 并查集
查看>>
Oracle常用数据类型
查看>>
信息安全技术 作业5
查看>>
Java关键字final、static使用总结
查看>>
python文件_批量改名
查看>>
暑假集训(3)第一弹 -----还是畅通工程(hdu1233)
查看>>
php集成工具
查看>>
uestc 1855, dfs, 模拟
查看>>
Word Ladder II
查看>>
Binary Tree Level Order Traversal
查看>>
30+ Excellent Windows Phone 7 Development Tutorials
查看>>
3. Longest Substring Without Repeating Characters
查看>>
(带权并查集) bzoj 1202
查看>>
(差分约束系统) poj 1201
查看>>
当下的互联网科技巨头们
查看>>
Json
查看>>
java Graphics2d消除锯齿,使字体平滑显示
查看>>