Programming in C++

NPRG041

2025/2026

Martin Svoboda

Department of Software Engineering

Warning (particularly to Erasmus students) - before you enroll to this course

This course assumes that all participants already acquired some experience in programming, understanding of object-oriented programming, and basic knowledge of C (or C++) and C# or Java. If you are a beginner in programming, you shall not enroll. If your experience covers only python, PHP, JavaScript, Pascal, FORTRAN, or similar languages, you may expect problems understanding some parts of the lecture.

For regular students of Computer Science, this assumption is covered by the prerequisities of the subject.

Communication

For communication on all aspects of this course, please use Mattermost. (Your emails are often classified as junk.)

For the first logging-in, you will need an invite-link, placed in the Notice-board module in the SIS. (This invite link is valid for several courses that share the same Mattermost team 2526 for the academic year 2025/26.) When registering, please choose a name corresponding to your real-life identity in SIS.

The channel nprg041-english is dedicated for the English-speaking students. The channel is intended for communication between teachers and students, as well as related discussions between students. In addition, you may use direct messages for non-public communication.

Tutorials and credits

Group 8: Wed 15:40 SW2

Exams

In accordance with the study regulations, the exam can be taken three times, the last result counts.

There will be at least one exam term during the summer exam period. Only the students who have been awarded the credit trom the tutorials (i.e. successfully delivered the programming project and acquired 20 points from home assignments) will be admitted to the summer exam terms. The capacity of the summer term(s) will be sufficient for students fulfilling this condition.

The exams take place in a computer lab (S[UW][12] or N8/11). To ensure equal environment, students must use only the computers of the lab, either in Windows or in Linux mode. The use of notebooks (or other computing devices not installed in the lab) is not allowed during the credit/exam tests. Students shall not use any resource other than the compiler, debugger, editor and/or IDE installed at the lab and the language reference manuals at cppreference.com or cplusplus.com. Before attempting an exam, make sure that you are familiar with the development environment at the lab computers.

The content of the exam is the programming of an assigned task within a time limit of 3.5 hours, including submission to the recodex system.

Each student must work independently.

The evaluation of the exam will be based not only on the result of the automated tests in recodex, but also on the assessment of the source codes.

Exams will be supervised by various teachers, the examiner name mentioned in SIS is just a placeholder.

Lectures

Group 2: Tue 10:40 S4

Lecture Slides

  • Lecture 01 - PDF - Pros and cons of C++, compilation and header files
  • Lecture 02 - PDF - Hello world, modules, declarations and definitions, references
  • Lecture 03 - PDF - Values, pointers, references
  • Lecture 04 - PDF - Passing arguments and returning by value and by reference, copy/move semantics, copy/move elision
  • Lecture 05 - PDF - Copy/move semantics, the Rule of Five, pointers, smart pointers, observers
  • Lecture 06 - PDF - References vs. pointers, conventions, containers, iterators
  • Lecture 07 - PDF - Algorithms, functors, lambda expressions
  • Lecture 08 - PDF - Templates, forwarding references, variadic templates
  • Lecture 09 - PDF - Classes, inheritance, virtual methods, conversions
  • Lecture 10 - PDF - Introduction to exceptions