Posted by: rmn on: 24/04/2010
There’s nothing like the “Eureka” moment when you eventually manage to solve a challenging puzzle. I’m a man of puzzles myself, and the ones I like the most are computer science, or programming related, puzzles. I’ve recently heard a pretty intriguing puzzle I would like to share with you.
Posted by: rmn on: 16/04/2010
A Quine is a computer program which prints a copy of its own source code as its only output. Thus it is theoretically possible to compile such a program, run it, and then have its output compiled again to produce the initial program – in an infinite loop, forever.
Posted by: rmn on: 21/03/2010
The handler std::terminate() is called whenever the exception handling mechanism cannot find a suitable catch clause for a thrown exception (and in some other cases. For example, when an exception is thrown during the handling of another exception – see this GotW post about std::uncaught_exception). It is possible to define a custom handler by using [...]
Posted by: rmn on: 19/02/2010
The possibility of overloading just about any C++ operator and having it do something entirely different from what it was designed for, can sometimes make life pretty hard. Here are a couple of examples: What if you wanted to take the address of an object, which had implemented an entirely different semantic for the ampersand [...]
Posted by: rmn on: 20/01/2010
Actual object memory layout can be a little tricky when inheritance and its virtual tables are involved. And it gets even trickier when pointer arithmetic is employed. Do you consider yourself a low-level expert?
Posted by: rmn on: 15/01/2010
One of the containers introduced within TR1 (which is already widely available – both in gcc and Visual Studio) is a Tuple type, which is adopted from The Boost Tuple Library. Tuple types are very convenient at times; For example, it is possible to return multipe values from a function through a tuple, or write [...]
Recent comments