Example Output:
-------------------------------------------------------------------------------- 1: File=data.dos, Size=0x3f (dec 63), Open mode=Text, Read mode=fgets -------------------------------------------------------------------------------- 2: LINE 1, Length=0x15 (dec 21) 3: Offset: 0 1 2 3 4 5 6 7 8 9 a b c d e f 10 11 12 13 14 4: Hex: 22 53 63 6f 74 74 22 2c 22 43 68 69 63 61 67 6f 22 2c 33 39 a 0 5: Char: " S c o t t " , " C h i c a g o " , 3 9 lf \0 -------------------------------------------------------------------------------- LINE 2, Length=0x13 (dec 19) Offset:*16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 28 Hex: 22 41 6d 79 22 2c 22 4e 6f 6b 6f 6d 69 73 22 2c 37 34 a 0 Char: " A m y " , " N o k o m i s " , 7 4 lf \0 -------------------------------------------------------------------------------- LINE 3, Length=0x14 (dec 20) Offset:*2a 2b 2c 2d 2e 2f 30 31 32 33 34 35 36 37 38 39 3a 3b 3c 3d Hex: 22 52 61 79 22 2c 22 4d 74 20 4f 6c 69 76 65 22 2c 37 38 a 0 Char: " R a y " , " M t O l i v e " , 7 8 lf \0 -------------------------------------------------------------------------------- 6: EOF at offset 0x3f (dec 63) --------------------------------------------------------------------------------
Notes:
This is the same format as used for the input files, so you can make a direct comparison between input and output.
The offset (line 3) may show an asterisk (*). This indicates that the starting offset for the current line is not the ending offset of the previous line + 1. This doesn't occur in binary mode, but is common when files are opened in text mode. The offset values were obtained using the ftell(), which doesn't necessarily return the absolute byte offset within the file in text mode due to character translation.
On the "Hex" and "Char" lines (4 and 5), the null-terminator is shown just to prove it's there. This was not read from the file, but was added by the program.
If your browser supports color, any special characters appear in red. This was not produced by the program, but was added to the HTML code after the fact.
< Back to Program Output | ^ Up to Top