C++ 1, Unicode 0

Posted by alastair
on March 09, 2007 22:14

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!

Continue reading...

Kata Four in C++

Posted by alastair
on February 26, 2007 23:37

On a whim, I attempted Dave Thomas’ Kata Four in C++. Yes that’s right, C++.

Here’s what I ended up with, feel free to throw peanuts.

Continue reading...