Non Printable character TAB?

Hi All,

Why TAB with ASCII value 9 is non printable character and SPACE with ASCII value 32 is printable?I can open any editor and press any of them and I see it on screen(If I press tab cursor is moved by tab, and space if I press space)

Then why one of them is printable and other non printable?


Thanks
Prasad
Not a answer to the question. But attaching the code which shows the method to print tab characters using character literal:

Code snip:
1
2
char tab='\t', space=' ';
printf("Tab:<%c>Space:<%c>\n",tab, space);


Output:
Tab:<   >Space:< >
Then we do we call TAB as unprintable?
Are you referring to std::isprint? Well, I'm not sure but I guess tab is more of a control character because it doesn't behave as a normal character. Space does have a fixed predictable width and behaves exactly like all the other "printable" characters.
tab is a control character. It sends commant to terminal to change caret position. It behavior can change depending on terminal (8 or 4 tab stop, should it overwrite characters it "jumps over" or shoud it keep it)

Space is a character like 'a'. Means it always uses one space (and advances caret one position) and some fonts moght even have a glyph associated with it.
@MiniPaaa

Thanks lot ...very clear.

@peter87,@ kannanmj


Thanks for replying.
Topic archived. No new replies allowed.