NPRG041: Programming in C++
Lectures:
Plan -
Slides
|
Labs:
Materials -
Plan -
Small Assignments -
Big Assignments -
Deadlines -
Topics
Basic Information
- Annotation:
Czech |
English
- Course webpage:
Czech |
English
- Lectures
- Group 02: Tuesday 12:20 - 13:50 (S4) [English]
- Labs
- Group 08: Tuesday 14:00 - 15:30 (SW2) [English]
- Group 06: Wednesday 12:20 - 13:50 (SW2) [Czech]
- Group 07: Wednesday 14:00 - 15:30 (S1) [Czech]
-
Table with activity points
Lectures: Plan [en]
- Tuesday 01. 10. 2024
- Tuesday 08. 10. 2024
- Tuesday 15. 10. 2024
- Tuesday 22. 10. 2024
- Tuesday 29. 10. 2024
Tuesday 05. 11. 2024: Canceled (Dean's Sports Day)
- Tuesday 12. 11. 2024
- Tuesday 19. 11. 2024
- Tuesday 26. 11. 2024
- Tuesday 03. 12. 2024
- Tuesday 10. 12. 2024
- Tuesday 17. 12. 2024
- Tuesday 07. 01. 2025
Lectures: Slides [en]
- 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
Labs: Materials
Labs: Plan
- Tuesday 01. 10. / Wednesday 02. 10. 2024: Class 01 - Subsets
- Tuesday 08. 10. / Wednesday 09. 10. 2024: Class 02 - Options - Files:
Messages.txt
- Tuesday 15. 10. / Wednesday 16. 10. 2024: Class 03 - Counter - Files:
Input-CRLF.txt |
Input-LF.txt |
Output.txt |
Exceptions.txt
- Tuesday 22. 10. / Wednesday 23. 10. 2024: Class 04 - Database I - Files:
Movies-CRLF.csv |
Movies-LF.csv |
Exceptions.txt
- Tuesday 29. 10. / Wednesday 30. 10. 2024: Class 05 - Expressions I
Tuesday 05. 11. (Dean's Sports Day) Wednesday 06. 11. (18:00 SW2) / Wednesday 06. 11. 2024: Class 06 - Expressions II - Files:
Exceptions.txt
- Tuesday 12. 11. / Wednesday 13. 11. 2024: Class 07 - Database II - Files:
Actor.h |
Movies-CRLF.csv |
Movies-LF.csv |
Movie.h |
Titles-CRLF.csv |
Titles-LF.csv |
Exceptions.txt
- Tuesday 19. 11. / Wednesday 20. 11. 2024: Class 08 - Matrix
- Tuesday 26. 11. / Wednesday 27. 11. 2024: Class 09 - Database III - Files:
Queries.h
- Tuesday 03. 12. / Wednesday 04. 12. 2024: Class 10 - Array I
- Tuesday 10. 12. / Wednesday 11. 12. 2024: Class 11 - Array II
- Tuesday 17. 12. / Wednesday 18. 12. 2024: Class 12 - Database IV - Files:
Queries.h
- Tuesday 07. 01. (14:00 SW2) / Wednesday 08. 01. 2025 (12:20 SW2 and
14:00 S1 17:20 SW2): Credit test
Labs: Small Assignments
- Monday 07. 10. / Tuesday 08. 10. 2024: Assignment C01 - Subsets - Instructions: Czech (version 9) | English (version 7)
- Monday 14. 10. / Tuesday 15. 10. 2024: Assignment C02 - Options - Instructions: Czech (version 11) | English (version 6)
- Monday 21. 10. / Tuesday 22. 10. 2024: Assignment C03 - Counter - Instructions: Czech (version 9) | English (version 4)
- Monday 28. 10. / Tuesday 29. 10. 2024: Assignment C04 - Database I - Instructions: Czech (version 9) | English (version 3)
- Monday 04. 11. / Tuesday 05. 11. 2024: Assignment C05 - Expressions I - Instructions: Czech (version 6) | English (version 2)
- Monday 11. 11. / Tuesday 12. 11. 2024: Assignment C06 - Expressions II - Instructions: Czech (version 5) | English (version 2)
- Monday 18. 11. / Tuesday 19. 11. 2024: Assignment C07 - Database II - Instructions: Czech (version 9) | English (version 3)
- Monday 25. 11. / Tuesday 26. 11. 2024: Assignment C08 - Matrix - Instructions: Czech (version 6) | English (version 4)
- Monday 02. 12. / Tuesday 03. 12. 2024: Assignment C09 - Database III - Instructions: Czech (version 4) | English (version 2)
- Monday 09. 12. / Tuesday 10. 12. 2024: Assignment C10 - Array I - Instructions: Czech (version 5) | English (version 4)
- Monday 16. 12. / Tuesday 17. 12. 2024: Assignment C11 - Array II - Instructions: Czech (version 4) | English (version 3)
- Friday 27. 12. / Friday 27. 12. 2024: Assignment C12 - Database IV - Instructions: Czech (version 3) | English (version 3)
Labs: Big Assignments
- Friday 22. 11. 2024: Assignment A01 - Regular expressions - Instructions: Czech (version 6) | English (version 3) - Files: Exceptions.txt
- Friday 03. 01. 2025: Assignment A02 - Graphs [compulsory] - Instructions: Czech (version 10) | English (version 5) - Files: Exceptions.txt
Labs: Deadlines
- Sunday 22. 12. 2024: topic selection
- Sunday 04. 05. 2025: project submission
- Sunday 01. 06. 2025: project finalization
Labs: Topics
- Class 01 - Subsets
- Organizational information
- Project structure, compilation, function main, program exit codes, include directives, standard libraries
- Problem decomposition, user-defined functions, modifiers const and constexpr
- Standard output stream std::cout, stream insertion operator <<, line endings
- Traditional array and its size, type size_t, basics of static and dynamic allocation
- Class 02 - Options
- Modules, header and source files, declarations and definitions, program arguments
- Traditional strings and strings std::string, container std::vector, type aliases, basics of loops and iterators, universal reference
- Passing of parameters (value, pointer, reference), function parameters (default values, output parameters), global named constants (const, constexpr)
- Class 03 - Counter
- Streams and files (read and write operations), standard streams std::cin, std::cout, streams std::istream, std::ostream, std::ifstream, std::ofstream
- Function std::getline (whole line granularity), functions std::isdigit and std::isalpha
- Parsing of numbers, functions std::stoi and std::stof
- Structures and classes, classes with static methods, function name overloading
- Traditional pointers (nullptr literal), full and partial namespace unfolding, comments
- Handling of exceptions (basic principles, throwing and catching string exceptions)
- Class 04 - Database I
- Classes with data members and methods (without inheritance), naming convention for private members, inline functions
- Parameterized constructors (parameters passed by value, constant reference, or rvalue reference)
- Member initializer lists (for class data members), initialization of standard containers
- Container std::set (containing items with predefined ordering), stream std::istringstream, function std::getline (with custom separator)
- Function std::move, emplace mechanism principles (emplace_back method on std::vector)
- Class 05 - Expressions I
- Non-trivial class hierarchy with simple inheritance, access specifiers for member visibility (public, protected, private), inheritance access levels (public, protected, private)
- Virtual functions, abstract classes and pure virtual functions, final classes, inheritance of constructors, virtual destructors, function overriding
- Dynamic allocation (individual items with non-trivial life cycle), operators new (allocation, construction) and delete (destruction, deallocation), safe deallocation
- Enumeration classes (enum class), general principle of wrapper classes
- Class 06 - Expressions II
- Polymorphic container (containing traditional pointers to base class instances), advanced work with traditional pointers
- Container std::stack, operations push, top, and pop
- Shunting-yard algorithm (method for parsing arithmetical or other expressions in infix notation)
- Memory leaks avoidance (ensuring atomicity of potentially unsuccessful chained dynamic allocations)
- Handling of exceptions (custom hierarchy of exception classes), std::bad_alloc exception
- Class 07 - Database II
- Container std::set (containing items without predefined ordering), custom comparison operator <
- Custom stream insertion << and extraction >> operators (with default separator)
- Member initializer lists (invocation of ancestor constructors), construct friend (class level), default and delete specifiers
- Shared smart pointers (std::shared_ptr, function std::make_shared), invocation of virtual functions via smart pointers
- Polymorphic container (containing smart pointers to base class instances), code refactoring principles
- Dynamic casting (traditional retyping, conversion operators dynamic_cast and std::dynamic_pointer_cast)
- Class 08 - Matrix
- General concept of templates, basic templates for classes and global functions (type name and value parameterization), dependent names and typename construct
- Container std::array, method fill
- Custom arithmetic operators (addition, multiplication, pre/postincrementation, ...) and two-level indexing operators (both modifiable and read-only variants)
- Inner classes, reference data members in classes, const_cast casting
- Copy-on-write mechanism
- Class 09 - Database III
- Containers std::map and std::multimap (items with / without predefined global ordering operators, structure std::less, custom ordering)
- Structure std::pair, inner components first and second, function std::make_pair
- Methods insert, emplace, find, equal_range, lower_bound, and upper_bound for map containers
- General concept of functors (function objects)
- Containers std::unordered_map and std::unordered_multimap (custom std::hash template specialization, global comparison operator ==, structure std::equal_to)
- Copy elision, observer pointer, structured bindings (map pairs)
- Structure std::tuple, function std::make_tuple
- Class 10 - Array I
- Custom elastic array container
- Manual dynamic allocation, functions malloc and free, placement new operator, explicit destructor invocation
- Initializer list constructors, structure std::initializer_list
- Standard exceptions, conditional sections using ifdef directives
- Class 11 - Array II
- Copy and move constructors and assignment operators, functions std::swap, noexcept keyword, Rule of Three / Five
- Nested templates, custom conversion operators
- Custom iterators (forward iterator, bidirectional iterator, random access iterator)
- User-defined namespaces
- Class 12 - Database IV
- General concept of lambda expressions (captures, parameters), functors and lambda expressions with input parameters and/or return values
- Standard Template Library (STL) (standard algorithms for working with containers)
- Functions std::copy, std::copy_if, std::remove_if, and std::transform, batch container construction, functions std::sort, std::for_each
- Fake iterators std::back\_inserter and std::ostream\_iterator
- Ranges, functions std::ranges::copy and std::ranges::sort, views std::views::filter and std::views::transform
- Doxygen documentation