Monthly Archives: March 2014

Puzzle – Easy : C++ Multithreading

Below is a small and easy puzzle on multi-threading, ideal for beginners. And to be honest, title should have been “C Multithreading” since it uses pthreads, and not C++11 for threading. So what would be the output? In what order … Continue reading

Posted in Programming | Tagged , , | Leave a comment

String’s length

Originally posted on Andrzej's C++ blog:
Let’s start with a small test. Is the following assertion correct? void test_length(std::string const& s) { assert(s.length() == strlen(s.c_str())); } It is not; otherwise I wouldn’t be mentioning this in the post; but…

Posted in Programming | Leave a comment