标题:很怪异的问题~~16进输出问题
只看楼主
nexus88
Rank: 1
等 级:新手上路
帖 子:8
专家分:0
注 册:2007-1-5
 问题点数:0 回复次数:1 
很怪异的问题~~16进输出问题

void WriteBinZ()
{
int cc;
FILE *gp;
gp=fopen("TTTTT29.bin","w+"); //建立一个BIN文件
scanf("%x",&cc); //以16进输入
fputc(cc,gp); //打到文件里去
}

大家帮我看下 为什么 输入A或者 0A 只要有A 时 输出结果变0D了?很怪异的

搜索更多相关主题的帖子: 怪异 输出 
2007-01-08 23:53
yvtianzll
Rank: 1
等 级:新手上路
帖 子:30
专家分:0
注 册:2006-9-13
得分:0 
fputc :Writes a character to a stream

eg: if you call it like this: fput(66,gp), at first ,it change the integer(66) to a character (c),then write c to the file.
so you will find there is a c in your file.
2007-01-13 14:00



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-114991-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.090093 second(s), 7 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved