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

node.js - Using Node without global install -

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

java - Null response to php query in android, even though php works properly -