您的位置:首页 > 其它

向文件写入127个ASCLL码,这程序是什么回事不行

2014-05-02 18:59 204 查看
# include <stdio.h>
int main()
{
char a=0;
FILE *fp;
errno_t x;
if ((x = fopen_s(&fp, "E:\\写入.txt", "wb")) == 0)
printf("the file was opened!\n");
else
printf("the file was not opened!\n");
for (; a < 128; a++)
fputc(a, fp);
fclose(fp);
}
文件已经打开,输入的是乱码

要是把11行128改为127,就可以了,这是为什么?
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: