Category Archives: Programming

Accelerated C++ Summary to Chapter 0 (Getting Started)

Chapter 0 of the Accelerated C++ book (by Koenig and Moo, reference at bottom) has provided me with an in-depth introduction of the classic Hello World C++ program in just 6 pages. As I see that there is an end of chapter exercise section and the book does not come with a solution (for good reason I guess!), I’ve decided to have a go doing these exercises and post my solutions in separate posts. Despite the book pretty much has covered it all, I would aim to include my own version of explanation for the benefit of learning and understanding. (My solution/explanation is subject to error as it’s just a scientific programming sketchbook after all!)

Although the (Hello World) program we’ve written is simple, we’ve covered a lot of ground in this chapter.

Key concepts learnt from this chapter: Hello World program; comment; #include directive; standard library vs core language; input-output stream (iostream); standard header; angle brackets; the main function; curly braces; operand type (int and std::iostream); output operator (<<); namespace (std); standard output stream (std::cout); stream manipulator (std::endl); the return statement; expression; result; side effects; operator vs operand; left-associative operator; scope; qualified name (std::cout); scope operator (::); free and non-free form structure; special string literals; escape using backslash; semicolons; expression statement; null statement.


Koenig, Andrew & Moo, Barbara E., Accelerated C++, Addison-Wesley, 2009

Add new Code::Block Editor Theme: Son of Obsidian

The Code::Block IDE by default only comes with one editor scheme called “default”, which is a standard white background with code syntax highlighting. I wasn’t a fan of the default theme and wondered whether there might be a way to import a readily built alternative theme without having to go through the trouble to manually create one myself.

After doing some “Google-ing” I came across this very good Code::Block Forum which led me to Pizaro’s instruction on Exporting and Importing Code::Blocks Themes and the Son of Obsidian theme config file. So I had a go using both the instruction and the theme config file.

The end result? It worked! Now in my Code::Block I have a new Son of Obsidian Theme which is much more user friendly (and cool) to work with. It has a dark background with sharper syntax highlighting.

If you are looking to do the similar I highly recommend you to check out these articles.

My solutions to the book Accelerated C++ (A. Koenig and B. Moo)

C++ is one of the most popular programming languages used in the scientific programming area. So I’ve decided to have a go learning it.

I’ve been recommended to start with this book called Accelerated C++ by Andrew Koenig and Barbara E. Moo (Published in 2000 by Addison Wesley). The book is very compacted (~300 pages) and is said to be suitable for beginner. The tag line is “Practical Programming by Example” – teaching only the bits and pieces that are required to solve most of the problems.

The book contains 17 chapters. At the end of each chapter is a list of problems to solve. As part of my learning I shall have a go solving these and post my solutions and feedback via posts.

It’s just learning.