C
chaobrenda
hi everyone,
i met some problem in this.
i used fseek to locate position prepared to be written.
for example,
fseek(stream,16,seek_set)
then
fputs(time,stream)
while time will be users input.
the content of the txt file to be modified
aabb, ccddeeff, 30gghhiijjkk
obvious the string 30(at byte position 16)
is going to be changed.
but if users input were 3000
then gg(position 18) will be overwrote.
i will get the result
aabb, ccddeeff, 3000hhiijjkk
but all i need is
aabb, ccddeeff, 3000gghhiijjkk
or EVEN users input were 300000
i still need the result to be
aabb, ccddeeff, 300000gghhiijjkk
how to do it?
thanks
i met some problem in this.
i used fseek to locate position prepared to be written.
for example,
fseek(stream,16,seek_set)
then
fputs(time,stream)
while time will be users input.
the content of the txt file to be modified
aabb, ccddeeff, 30gghhiijjkk
obvious the string 30(at byte position 16)
is going to be changed.
but if users input were 3000
then gg(position 18) will be overwrote.
i will get the result
aabb, ccddeeff, 3000hhiijjkk
but all i need is
aabb, ccddeeff, 3000gghhiijjkk
or EVEN users input were 300000
i still need the result to be
aabb, ccddeeff, 300000gghhiijjkk
how to do it?
thanks