我用C写一个最简单的CGI程序,输出结果为乱码

wengpeisen wengpeisen 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
#include <stdio.h>
int main(int argc , char **argv)
{
printf("Content-type:text/html\n\n");
printf("<HTML>\n");
printf("<HEAD>\n");
printf("<TITLE>");
printf("hello,the world!");
printf("</TITLE>\n");
printf("</HEAD>\n");
printf("<BODY>\n");
printf("<H2>hello , the world</H2>\n");
printf("</BODY>\n");
printf("</HTML>\n");
return 0;
}
这个程序在fedora core 6 上运行,结果是输出一些乱七八糟的东西,而不是我想要的输出hello,the world!, 这是为什么呢?哪位高人能给我指点一下,谢谢了
...全文

相关推荐

评论 19
收藏 已收藏
分享
返回顶部
wengpeisen
CGI 2,203 成员 4,518 内容