c语言:输出(Welcome??)和(Welcome\?\?)

2015-11-24 13:01:45 · 作者: · 浏览: 61
程序1:
#include
int main()
{
? printf("(Welcome??)");
? ?return 0;
}
结果:
(Welcome]
?
?
? ? ? ? ? ? ?Press any key to continue
错误在于应该使用\?,防止被解析成三字母词,正确程序如下:
程序2:
#include
int main()
{
??
? printf("(Welcome\?\?)");
? return 0;
}
结果:
(Welcome??)
?
?
? ? ? ? ? ? ?Press any key to continue
程序3
#include
int main()
{
??
? printf("(Welcome\\?\\?)");
? return 0;
}
结果:
(Welcome\?\?)
?
?