c - What are trailing blanks and tabs? K&R Exercise 1.18 -


in ex 1.18 of kernighan & ritchie's c programming language, reader asked write program remove trailing blanks , tabs, , delete entirely blank lines. meant trailing blanks , tabs? consecutive tabs or spaces trailing blanks , tabs? entirely blank line means consecutive '\n' s or "\n \n" considered blank line too?

trailing whitespace refers whitespace follows last non-whitespace character of line.

i think "\n \n" should considered blank line (that's blank vs. empty distinction used apache stringutils: empty strings have length 0, blank strings contain whitespace). you'll delete them either way, since you'd delete trailing whitespace first, leaving them empty.


Comments

Popular posts from this blog

How to access a php class file from PHPFox framework into javascript code written in simple HTML file? -

node.js - Using Node without global install -

java - JavaScript + Thymeleaf - select onchange -