Termbank
  1. A
    1. API
    2. ASAN
    3. Access specifiers
  2. C
    1. Constructor
    2. const
  3. G
    1. GDB
    2. g++
  4. M
    1. Make
    2. Memory Leak
  5. P
    1. Pointer
  6. R
    1. Recursion
  7. S
    1. std
  8. V
    1. Valgrind
Completed: / exercises

Coursework and Deadlines at a Glance

Team Work: Labs Labs Deadlines Solo Work: MPs MPs Deadline
Getting Started: Set Up Your Laptop
LAB1_INTRO 2025-03-17 23:59 MP1_MAKE 2025-03-17 23:59
LAB2_DEBUG 2025-03-24 23:59 MP2_INTRO 2025-03-24 23:59
LAB3_MEMORY 2025-03-31 23:59
LAB4_INHERITANCE 2025-04-07 23:59 MP3_COLLAGE 2025-04-07 23:59
LAB5_GDB 2025-04-15 23:59
LAB6_DICT 2025-04-21 23:59
LAB7_PIXELMANCY 2025-04-30 23:59

Lectures and Labs Schedule

Lecture Date Place Lecture Topics Lab Date Place
11.03.25,12:15 L7 1. "Hello World", classes 12.03.25,10:15 -12:00 TS128
12.03.25,14:15-16:00 L8
13.03.25,10:15 -12:00 SÄ124
14.03.25,12:15 L7 2. Constructors, .cpp/.h, encapsulation 13.03.25,14:15-16:00 IT115
18.03.25 ,12:15 PR101 3. Variables, types, memory, pointers, references 19.03.25,10:15-12:00 L9
19.03.25,14:15-16:00 TA101
20.03.25,10:15-12:00 L1
21.03.25 ,12:15 L7 4. Debugging, errors, exceptions 20.03.25,14:15-16:00 L2
25.03.25 ,12:15 PR101 5. Raw pointers, c-style arrays, modern alternatives 26.03.25,10:15-12:00 TS128
26.03.25,14:15-16:00 TA101
27.03.25,10:15-12:00 L2
28.03.25 ,12:15 TS101 6. Resources and RAII, parameter passing, return 27.03.25,14:15-16:00 TA101
01.04.25 ,12:15 PR101 7. Constructor, destructors, essential operations 02.04.25,10:15-12:00 TS128
02.04.25,14:15-16:00 SÄ111
03.04.25,10:15-12:00 TS128
04.04.25 ,12:15 L7 8. Inheritance, dynamic polymorphism 03.04.25,14:15-16:00 SÄ111
08.04.25 ,12:15 PR101 9. Static polymorphism, templates 09.04.25,10:15-12:00 SÄ111
09.04.25,14:15-16:00 SÄ111
10.04.25,10:15-12:00 PR101
11.04.25 ,12:15 L7 10. STL, iterators 10.04.25,14:15-16:00 TA101
15.04.25 ,12:15 PR101 11. STL, maps 16.04.25,10:15-12:00 TS128
16.04.25,14:15-16:00 L8
17.04.25,10:15-12:00 PR119
17.04.25 ,12:15 L4 12. Invited lecture, Ville Voutilainen, Qt 17.04.25,14:15-16:00 TA101
22.04.25 ,12:15 L7 No lecture 23.04.25,10:15-12:00 TS128
23.04.25,14:15-16:00 L8
24.04.25,10:15-12:00 L9
25.04.25 ,12:15 L7 No lecture 24.04.25,14:15-16:00 SÄ111
Vappu week
06.05.25 ,14:15 L6 Final Exam
28.05.25 ,14:15 L2 Final Exam: Retake 1
18.06.25 ,14:15 TA105 Final Exam: Retake 2
?
API stands for Application Programming Interface. In the context of this course, you can consider the header files to be such interfaces, as they determine what class functions and properties are public and thus accessible from anywhere.
AddressSanitizer (ASAN) is a memory error detector for C/C++. In this course, the makefiles will typically compile an executable that uses ASAN, with "-asan" at the end of its name.
The two notable access specifiers are:
  • public: class members defined after the public keyword are accessible from outside the class.
  • private: class members are generally private by default and thus not accessible from the outside
Constructor is a special non-static member function of a class that is used to initialize objects of its class type. A constructor is called upon initialization of an object. A constructor without arguments is a default constructor, but constructors that take arguments can be defined.
GDB, the GNU Project debugger, allows you to see what is going on `inside' another program while it executes -- or what another program was doing at the moment it crashed.
GDB can do four main kinds of things (plus other things in support of these) to help you catch bugs in the act:
  • Start your program, specifying anything that might affect its behavior.
  • Make your program stop on specified conditions.
  • Examine what has happened, when your program has stopped.
  • Change things in your program, so you can experiment with correcting the effects of one bug and go on to learn about another.
GNU Make is a tool which controls the generation of executables and other non-source files of a program from the program's source files. Make gets its knowledge of how to build your program from a file called the makefile, which lists each of the non-source files and how to compute it from other files. When you write a program, you should write a makefile for it, so that it is possible to use Make to build and install the program.
Memory leak means that the program is not freeing up memory it reserves. The memory will be freed when the program terminates, but if a program keeps leaking more and more memory without terminating, it can become a huge issue!
A typical way for memory leaks to occur is reserving memory with new and not calling delete before the pointer goes out of scope.
Pointer variables store a memory address as their value. In other words, they point to some data. The data can be accessed by dereferencing the pointer. (Either like *p or p->...)
A recursive function calls itself from within it. The recursion call must be conditional or it would lead to an infinite loop.
Valgrind is another tool besides ASAN that you can use in this course. It can detect many memory-related errors that are common in C and C++ programs and that can lead to crashes and unpredictable behaviour.
const is a keyword meant to mark something as immutable
  • A const object cannot be modified: attempt to do so directly is a compile-time error, and attempt to do so indirectly (e.g., by modifying the const object through a reference or pointer to non-const type) results in undefined behavior.
  • const keyword on an object's member function prevents the object from being modified in the function
  • Pointer declarations can have 2 const keywords, one to make the data that's pointed at unable to be modified and one to make the pointer itself unable to be modified
Using const improves code readability and prevents accidental modification of objects.
g++ is a C++ compiler that we primarily use for this course. It is the C++ compiler for the GNU compiler collection. You may sometimes see gcc being used instead of g++, which was originally the GNU C compiler, but calling gcc generally also compiles .cpp files as C++. However, calling g++ is preferred.
In C++, std stands for Standard Library, which is a collection of commonly useful classes and functions. Typically, these are defined in the std namespace.