<分区>
printf("%c","abcdefgh"[4]);
以下程序的输出是e
。但是不知道怎么样?我在谷歌和这里搜索了很多但没有找到这段代码的正确解释。我得到的这段代码的解释:
"This is for getting one
char
only. i.e, the 4thchar
starts from0
. So the answer is'e'
".
<分区>
printf("%c","abcdefgh"[4]);
以下程序的输出是e
。但是不知道怎么样?我在谷歌和这里搜索了很多但没有找到这段代码的正确解释。我得到的这段代码的解释:
"This is for getting one
char
only. i.e, the 4thchar
starts from0
. So the answer is'e'
".
最佳答案
字符串文字是数组,因此可以索引到:"abcdefgh"[0]
is 'a'
,例如。
关于c - 这个 printf 是什么意思?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11907030/