由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Programming版 - C语言中关于fseek和fscanf/fgets的怪事。
相关主题
C语言里的<<=是什么意思?c里从文件读数据,什么方法比较好?
easy problem coconutPerl and Matlab Question
地址空间里的一个BYTE不能写入(是合法地址)A question about class size
请教一道C语言的题目C中的精度问题
请教几个汇编语言的问题请教一个用matlab tcpip函数的问题
关于fscanf格式化读取的问题.C++ Q 108: swap
【请教】fscanf 和 fstream 哪一个更好? (转载)python question, easy one
两个面世题C的fscanf的问题
相关话题的讨论汇总
话题: int话题: fgets话题: c语言话题: fscanf话题: fseek
进入Programming版参与讨论
1 (共1页)
s********1
发帖数: 581
1
有一个text file input.txt,内容只有一行,如下:
12345
t****t
发帖数: 6806
2
so who told you "12345" is an int with 4 bytes?

【在 s********1 的大作中提到】
: 有一个text file input.txt,内容只有一行,如下:
: 12345

s********1
发帖数: 581
3
I wrote it into input.txt as an int. Also it's within the int range. what
else could it be?

【在 t****t 的大作中提到】
: so who told you "12345" is an int with 4 bytes?
t****t
发帖数: 6806
4
according to your logic, it's also within the 16bit short range. why it is
not a 16bit short?
it's also with a 64bit long long range. why it is not a 64bit long long?

【在 s********1 的大作中提到】
: I wrote it into input.txt as an int. Also it's within the int range. what
: else could it be?

s********1
发帖数: 581
5
I wrote it into the file as an int not as other data format.

【在 t****t 的大作中提到】
: according to your logic, it's also within the 16bit short range. why it is
: not a 16bit short?
: it's also with a 64bit long long range. why it is not a 64bit long long?

t****t
发帖数: 6806
6
if you write it into the file "as a short", does it make a difference?
most probably, it doesn't. therefore you didn't write it into the file "as
an int".

【在 s********1 的大作中提到】
: I wrote it into the file as an int not as other data format.
f*****Q
发帖数: 1912
7
老大你又拿新同学开玩笑。
b***i
发帖数: 3043
8
你输出了字符串呗
你打开写的是一般的文本文件

【在 s********1 的大作中提到】
: I wrote it into the file as an int not as other data format.
1 (共1页)
进入Programming版参与讨论
相关主题
C的fscanf的问题请教几个汇编语言的问题
老魏老姜老霸,我出银子给你们开机器关于fscanf格式化读取的问题.
java里run curl system command的问题【请教】fscanf 和 fstream 哪一个更好? (转载)
[合集] i++ * i++?两个面世题
C语言里的<<=是什么意思?c里从文件读数据,什么方法比较好?
easy problem coconutPerl and Matlab Question
地址空间里的一个BYTE不能写入(是合法地址)A question about class size
请教一道C语言的题目C中的精度问题
相关话题的讨论汇总
话题: int话题: fgets话题: c语言话题: fscanf话题: fseek