General information

Course type AMUPIE
Module title C/C++ Programming Course
Language English
Module lecturer dr Michał Mucha
Lecturer's email
Lecturer position starszy wykładowca
Faculty Faculty of Physics
Semester 2021/2022 (summer)
Duration 45
USOS code 4-W-CCPC-45


Classes will be held on Wednesday at 15:30 hrs

at Morasko campus Collegium Physicum segment F,

computer laboratory room no 60.

Module aim (aims)

Introduction to C/C++ programming. Students should get acquainted with all elementary language structures, should be able to write simple programs using input/output operations, pointers, dynamic memory allocation as well as working with objects and use of inheritance. Afterwards more emphasis would be put on improvement of programming skills. Learning of using exceptions, template library, creating and using dynamically linked libraries, system API calls and creating multithreaded programs.

Pre-requisites in terms of knowledge, skills and social competences (where relevant)

Minimum knowledge of mathematics at the level of secondary school (lyceum). Preferable completed basic mathematics course (including algebra).


Week 1: Compilation. Identifiers. Simple (build in) data types. Binary representation of data types. Errors, precision and stability.

Week 2: Operators. Scope and visibility of variables. Flow control instructions. Conditional instructions. Loops.

Week 3: Functions scanf and printf. Formatting strings in c. Operators ++ and ––. Calling functions with arguments.

Week 4: Pointers. Tables. Structures. Anonymous structures. User defined types in C. Structure fields (members) access. Structures and function calls. Bit fields. Bit fields declaration. Unions. Pointers declarations. Pointers arithmetic. Pointer conversion.

Pointers to functions. Constants and pointers.

Week 5: Variable initialization. Input/output operations in C. Examples/Exercises: Matrix multiplication. Dynamic string table. Pascal style table allocation. Toss up simulation. Basic run time library string functions. List. Stack.

Week 6: Classes. Objects. Class declarations. Inheritance. Class fields/members access. Access to parent and child class members. Virtual base classes. Friend functions.

Week 7: Input output operations in C++. Classes: ofstream, ifstream, fstream. Operator >>. Operator operator. Definitions of increment and decrement operators. Changing definition of &&, || operators.

Week 9: Virtual functions. Abstract classes. Polymorphic classes. Exceptions. Exceptions in constructors. Implicit type conversion in functions. new and delete operators. Placement new operator. Operator delete. Tables.

Week 10: Macros. Nested parenthesis and commas. Token insertion using ##. Changing of variable identifier to string using #. Conditional compilation.

Week 11: Templates. Function templates. Function template overriding. Explicit and implicit function templates. Class templates. Templates arguments. Angle brackets in templates.

Week 12: Standard Template Library overview. STL and C++ ANSI/ISO standard. Nice classes. Functional object. Containers. Vector. List. Double ended queue. Set. Map. Iterators. Input / output iterators. Unidirectional iterators. Bidirectional iterators. Random access iterators. Algorithms and functional object. How to create generic algorithm?

Week 13: Other STL related topics. Adaptors. Stack. Queue. Priority queue. Iterator Adaptors. Reverse Iterators. Insert Iterators. Function Adaptors. Negators. Binders. Adaptors for pointers to functions. Allocators and memory use. Iterator Tags. Associative containers

Week 14: Mutex. Semaphore. Smart pointers. Threads. Thread created using Windows API. Thread synchronization. Higher priority thread. Thread with critical section

Week 15: Directory search using Shell API. Wininet API. cURL library. Working with dll libraries.

Reading list

a. Kernigham Brain, Ritchie Dennis, „Język ANSI C” WNT Warszawa 1998
b. Stroustrup, Bjarne „Język C++” wydanie 4 WNT Warszawa 1998. Oryginał „The C++ programming language” -- 2nd ed. Addison-Wesley 1993
c. Eckel Bruce, “Thinking in C++. Edycja polska.” Helion. Gliwice. Na stronie internetowej dostępne są (za darmo) oryginalne wersje tej oraz innych książek autora „Thinking in C.”, „Thinking in Java”.
d. Vandevoorde David, Josuttis Nicolai M., „C++ Szablony.” Helion Gliwice 2003. Oryginał “C++ templates: The complete Guide.” Pearson Education Inc. część Addison Wesley 2003.
e. Meyers Scott, „Język C++ bardziej efektywny” Wydawnictwa Naukowo-Techniczne, Warszawa1998. Oryginał „More Effective C++. 35 New Ways to Improve Your Programs and Designs” Addison-Wesley 1996.
f. Josuttis Nicolai M., „C++ biblioteka standardowa. Podręcznik programisty.” Helion Gliwice 2003. Oryginał „The C++ Standard Library: A Tutorial and Reference” Pearson Education Inc. część Addison-Wesley 1999.
g. Andrew Koenig, Barbara E. Moo, „Accelerated C++. Practical Programing by Example”, Pearson Education część Addison-Wesley Professional 2000. Polskie tłumaczenie „C++ potęga języka” Helion Gliwice 2004
h. Grębosz Jerzy, „Symfonia C++” tomy 1 -- 3, Oficyna Kallimach. Oraz inne książki tego autora poświęcone językom C i C++.
i. Hansen Tony, „C++ zadania i odpowiedzi” wydanie drugie WNT Warszawa 1994. Oryginał „The C++ Answer Book” Addison-Wesley 1990
j. Plauger P. J., „Biblioteka standardowa C++” WNT Warszawa 1997. Oryginał „The Standard C++ Library” Prentice Hall, Inc.
k. Jacek Galowicz “C++17 STL Receptury”, Helion Gliwice 2018. Oryginał “C++17 STL Cookbook” Packt Publishing 2017.
t. and references therein.
x. Compiler documentation