2

I am parsing text using C and am getting an output of 0019 boxes in the terminal. After some research I have found that these are END OF MEDIUM control characters:

"Intended as means of indicating on paper or magnetic tapes that the end of the usable portion of the tape had been reached." - Wikipedia

How do I look for them and not include them in the output? Such as an if statement looking for them. They do not have an actual character so Im not sure how I would go about actually looking for them. Is it possible to use their HEX value (0x0019) to find them?

EDIT: I am parsing through html so I see no reason for that character to be there..

Andrei0427
  • 573
  • 3
  • 6
  • 18

1 Answers1

2

You could use e.g. isprint or it sibling functions.

Some programmer dude
  • 400,186
  • 35
  • 402
  • 621
  • if(!iscntrl(*line)) prints the characters regardless if theyre control types or not, any other suggestions? I have also tried isprint(); too – Andrei0427 Jan 01 '13 at 20:32
  • 1
    `isprint(c)` or `iscntrl(c)` only checks one character at a time; `isctrl(*line)` checks only the first character of the line. – mark4o Jan 02 '13 at 01:04
  • I forgot to terminate my char[] arrays with a '\0' so it was trying to make them all of equal length! – Andrei0427 Jan 02 '13 at 18:23