您的位置:首页 > 编程语言 > C语言/C++

C语言的格式化输入练习

2010-03-16 21:12 267 查看
看到了一个联系题,问题是如何格式化输出%.自己写了一个测试程序。对程序%输出进行测试。代码如下(用两个%,即可输出一个%):
#include <stdio.h>
int main()
{
printf("%%\"\n");
printf("Hello World\n");
return 1;
}在shell输出的结果如下:
xiaopeng@xiaopeng-desktop:~/test$ gcc -o format.o format.c
xiaopeng@xiaopeng-desktop:~/test$ ./format.o
%"
Hello World
xiaopeng@xiaopeng-desktop:~/test$
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: