Discussion:
still no response to orig post - anybody?
(too old to reply)
Liu Brian Su-Hou
2003-12-02 07:53:19 UTC
Permalink
I really can't find what's wrong. How is it possible that my program is
able to encode/decode text files perfectly regardless of size and doesn't
work when I try to do bin,jpg,etc..
John Tan
2003-12-02 14:41:46 UTC
Permalink
What type of variable is receiving the value from fgetc()?

If u use something like char c = fgetc() that is the problem, you need to
change to int c = fgetc()
Post by Liu Brian Su-Hou
I really can't find what's wrong. How is it possible that my program is
able to encode/decode text files perfectly regardless of size and doesn't
work when I try to do bin,jpg,etc..
Liu Brian Su-Hou
2003-12-02 20:22:49 UTC
Permalink
It's an int so I don't think that's the problem.
Post by John Tan
What type of variable is receiving the value from fgetc()?
If u use something like char c = fgetc() that is the problem, you need to
change to int c = fgetc()
Post by Liu Brian Su-Hou
I really can't find what's wrong. How is it possible that my program is
able to encode/decode text files perfectly regardless of size and doesn't
work when I try to do bin,jpg,etc..
Tor M. Aamodt
2003-12-03 05:52:16 UTC
Permalink
It should work fine with binary files. Therefore, I'd say you have a bug.



Now, what type of bug would lead to the strange behavior you observe? Well,
for starters does it work with multiline text files or just with a single
line text file? If that does not help I suggest you debug your software
using e.g., "gdb", to find out what the problem is.



Tor
Post by Liu Brian Su-Hou
It's an int so I don't think that's the problem.
Post by John Tan
What type of variable is receiving the value from fgetc()?
If u use something like char c = fgetc() that is the problem, you need to
change to int c = fgetc()
Post by Liu Brian Su-Hou
I really can't find what's wrong. How is it possible that my program is
able to encode/decode text files perfectly regardless of size and doesn't
work when I try to do bin,jpg,etc..
Continue reading on narkive:
Loading...