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?

Recommended Answers

All 5 Replies

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.

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

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.

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

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.