Yes, another C++ post. Yes, I’ve been doing a lot of it lately.
Recently on WorseThanFailure there have been several incidences of functions intended to perform relatively simple string manipulation tasks. Being worthy of posting to WTF, they have of course been hilariously over-long, complicated and bug-ridden. One recent example was attempting to compare two strings in a case-insensitive manner. Another was attempting to remove spaces from a string.
I’m going to have a go at a similar problem, namely writing a C++ program to count whitespace characters in a file.
Ready to follow along? Good!


