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