C++ Programming WS2016/2017



* The runtime is measured on an Ubuntu 16.04. system with an XX CPU (with 8 cores hyperthreading). It is determined as the minimum of three runs. The sequences are passed to the program in the order 'sox3.fas', 'sry.fas'.

** clang: clang++ (version 3.9.1) | gcc: g++ (version 5.4.0)
Thread model: posix
boost (version 1.63.0)

Course material

The slides and exercise sheets will be uploaded on this page.













































A simple Makefile project: SimpleProject

A more advanced Makefile project with separate declaration and definition: AdvancedProject

A possible matrix implementation (sheet_07 exercise 1): matrix.cpp

Final Project

The project description can be found here: cpp_final_project.pdf

The compressed sequence files and a small python script for plotting the results can be found here:

The project description will be discussed in detail (including an example on the board) in the 13th lecture at 30.01.2017.

You can use the file homo_sapiens_chr1_GRCH38.p7.fas to test the performance of your sequence-reading function. Use the sequences in sox3.fas and sry.fas for the actual comparison. If you are able to get a python interpreter installed on your system, you can plot the results of your program with help of the plotSMDresults.py script. Otherwise you can use any spreadsheet-programm like MS Excel or Libre Office to create scatter plots from your csv data.

Hand in your solutions by email until 18.04.2017 (23:59:59). Also send me your full name, your subject of study and your faculty for creating the certificates.

If you have any problems solving the project whatsoever, do send me an email and I will help you. We can also have a meeting at my office if necessary.

Plotting the results of your program should lead to figures similar to these (above without postprocessing, below with postprocessing):

Time and place

The teaching language will be English. Questions in German will be permitted.


Mon 16:15-17:45 at P7.2.03 

Exercise classes:

Mon 18:00-19:00 at P7.2.02.1

Registering and asking questions

If you are an 'electrical systems engineering' student it would be kind of you to register in the PAUL system to attend the course. If you are a student from another field you do not have to register in order to attend this course.

Please feel free to ask questions during the exercises or send mail.

This course is an optional offer, unfortunately you will not get credit points for attending this course. However, you will gain a lot of useful knowledge and increase your value on the job market. If you achieve 50% during the exercises and successfully manage the final project, you will obtain a certificate that documents your effort and your gained programming skills. (Note that you can not fail this course.)


C++ is a general purpose programming language and one of the most popular languages for both systems programming and application programming. The language allows you to write programms close to the metal and gives the programmer full control over the systems resources but C++ includes decent mechanisms for abstractions as well. Another observation is that programms written in C++ often result in highly efficient machine code, since the language maps very well to the von Neumann architecture. These are just a few characteristics of the language which make it to be in great demand.

The more recent standards like C++11 and C++14 upwards (often called modern C++) provide new powerful mechanisms and concepts that make programming in this language a lot easier than a few years ago.

During this course you will learn the basics (and probably a bit more) about modern C++ which provides a powerful tool for solving problems.


The C++ programming language is taught from scratch, so students without any programming background are welcome!


During the winter semester, we are going to study the following concepts in C++ programming:

Background and basic introduction:

  • history of C and C++
  • programming enviroments
  • basic terms / concepts

Basic C++ programming:

  • primitive variable types
  • expressions / statements
  • functions
  • memory management / pointers / arrays
  • structures / unions / enumerations
  • strings / vectors
  • classes
  • smart pointers / move semantics

The C++ standard template library (STL):

  • IO library
  • containers
  • generic algorithms

Advanced techniques:

  • operator overloading
  • template programming
  • object-oriented programming
  • embarrassing parallel: OpenMP

Useful libraries for further projects:

  • common used C++ libraries

Learning outcomes

After having attended this course, students might obtain following benefits:

  • understand modern C++
  • be confident to take advanced courses that require C++ programming
  • the ability to easily realize elegant programming tasks/ projects
  • promoted from a C programmer to a state-of-art C++ programmer
  • the ability to develop a real object-oriented program
  • gain additional understanding of how a computer works
  • better understanding of (computationally) problems
  • know where to find the desired information to realize a challenging task on your own

Useful literature

[1] A Tour of C++, Stroustrup 2013 (overview)

[2] The C++ Programming Language (4th Edition), Stroustrup 2013 (details)

[3] C++ reference: http://en.cppreference.com (reference)

[4] C++ Tutorial: http://www.cplusplus.com/doc/tutorial/ (a nice tutorial)

[5] CppCon experts sharing their knowledge: https://www.youtube.com/user/cppcon (really advanced concepts)


There will be weekly exercise sheets. The aim of the exercise sheets is to deepen your knowledge and your understanding of the C++ programming language. You need to achieve at least 50% of all points to be admitted to the final (small) project.

In the final project you have to create a small command-line application which implements a useful algorithm. During the project you will make use of the previous learned content.

The weekly exercise classes (see above) serve the following purposes: present the solution of the previous exercise sheet, answer questions and give some hints for the current exercise.

If you have questions to the organisation of the course, the topic, to the exercises or you get stuck during solving the exercises, please contact me via email. I try to answer as soon as possible.