相关疑难解决方法(0)

在多个字符上使用C++时,单引号有什么作用?

我对这段代码感到好奇:

cout << 'test'; // Note the single quotes.
Run Code Online (Sandbox Code Playgroud)

给我一个输出1952805748.

我的问题:输出是内存中的地址还是什么?

c++ quotes

279
推荐指数
4
解决办法
2万
查看次数

在char中分配多个字符

为什么这个程序提供输出 'y'

#include <stdio.h>

int main(void) {
    char ch='abcdefghijklmnopqrstuvwxy';
    printf("%c",ch);
    return 0;
}
Run Code Online (Sandbox Code Playgroud)

代码在ideone

c char

2
推荐指数
1
解决办法
5822
查看次数

标签 统计

c ×1

c++ ×1

char ×1

quotes ×1