I’m doing a homework assignment in which I need to print out to the console and a text file the numbers 0-255 along with the Hex and Ascii which goes along with them.
The main focus of the assignment is to learn about formatting and file handling.
I’ve figured out all the nice formatting by using widths and I can print things out to the file no problem.
I’m using %d %X %c for my printf().
My pet peeve is that ASCII 11, 12 and 13(???) are something like tab, lf and some other non-image char.
This totally screws with those two rows and I’m a wee bit anal about stuff like this.
Is there a fast and easy way to get something else to show up that won’t screw with my columns and rows or do I need to put in if-statements and filter these guys out myself?
You’ll need to filter out things you don’t want to print yourself.
To help with that, look into the
isgraphand the otheris*functions. They should help you along pretty well.