C/C++ Programming (2021-12-06 - 2021-12-10, 2022-01-24 - 2022-02-04)#

2021-12-06#

2021-12-07#

2021-12-08#

2021-12-09#

2022-01-24#

Undefined Behavior#

Undefined behavior ist commonplace in C. C++ takes long turns to get undefined behavior out of the way. For example:

  • Array bounds read/write

    • It is perfectly ok to read and write past the boundaries of an array. At least this is ok for the compiler; occasionally the program will exhibit undefined behavior - for example when you write into variables in the neighborhood. See undefined-behavior.c.

    • C++ brings data structures like std::vector that can do this better. See undefined-behavior-c++.cpp.

  • Integer overflow bugs are the norm - happily mix signedness and unsignedness, happily mix various integer widths. See overflow-recap.cpp.

  • Structures (struct) recap; struct-recap.cpp, again with an array bounds write.

  • Pointers recap; pointer-recap-recap.cpp.

  • Functions recap; power-recap.c.

Modularization#

2022-01-25#

C++ and OO (Classes)#

Modularization (again)#

2022-01-26#

Modularization: Repeating Important Topics (Quickly)#

Classes (continued)#

2022-01-27#

2022-01-28#

Standard Template Library: Container Templates#

2022-01-31#

2022-02-01#

Algorithms#

Functors#

Operator Overloading#

Unified Modeling Language (UML)#

Wikipedia

  • UML class diagrams

    ../../../../_images/uml-class.png
  • UML sequence diagrams

    ../../../../_images/uml-sequence.png

Exercise (Using All From Today)#

2022-02-02#

  • Resolve exercise from yesterday

Associative Container: std::map#

Exceptions, and Exception Handling#

2022-02-03#

2022-02-04#

C++11: A New Language#

Dynamic Allocation, Smart Pointers#

Multithreading#

Live hacked:

2022-02-07: Start of Exercise Week#

  • Moving to Linux: WSL2

  • Install prerequisites

    $ sudo apt install cmake build-essential libsqlite3-dev libboost-all-dev libgtk-3-dev
    
  • Unit testing framework documentation: Boost Test Library: The Unit Test Framework

  • class UserDB is now an interface

    ../../../../_images/userdb-iface.png
  • Into the wild …

    • Requirements not defined in prosaic words anymore: test driven development

    • Roman going mad: using wxWidgets to build a GUI on top of our user database