Tag Archives: Solutions

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.

References

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

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.