0

hi,

This is a doubt about the pseudo-eof.If i have an 8 bit system, Then the pseudo eof has to be above 8 bits...so should i allocate 16 bits for every character just so that my eof can exist?..if its a 16 bit system I have to use 24 bits?

3
Contributors
5
Replies
6
Views
9 Years
Discussion Span
Last Post by ArkM
0

What is meant by pseudo-eof? If it's EOF macros from C stdio.h header then it's not a char value, it's int type value returned by stream input functions. So this EOF is not a char from the file (and no problems with 8-bit or 16-bit values at all).
Take into account that all these functions return int values.

0

no..a pseudo eof is a character you add so that you can stop before eof

0

0x1A is the EOF character (8 bits) generally used in text files.

If you're talking about huffman coding; you could code your eof symbol in just the same manner as you would for any other character - it will have a occurance count of 1 and will therefore be one of the longest symbols.

0

yes..but how do i represent it..what do i write for its value

0

To present it in the source program? '\x1A'.
To present it in a print listing? But there are lots of non-printable characters in text files, not only '0x1A": tab or form feed or carriage return, for example. One of possible solutins: skip all non-printable characters. Another solution: make a table with character names.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.