To compile the programs, execute make
at the top level directory
or individually per each directory of examples.
- "Hello world!"
- "Hello world!" - variant without "using namespace std"
- "Hello world!" - variant with chaotic indentation
- Factorial
- Factorial (again) (
factorial
) - Maximum of two
int
values (max
) - Leap years (
is_leap_year
) - Days in a month (
days_in_month
) - Prime number check (
is_prime
) - Reference variables
- Call-by-reference (
get_min_max
)
point2d
struct typeinterval
struct typestruct
memory alignment and paddingstruct
types and arrays combinedreverse
function overint
arrayslength
,copy
andconcat
C-string functions- Range-based
for
loops - Buffer overflow - example 1
- Buffer overflow - example 2
- Pointer basics - the
&
and*
operators - Pointers and arrays
- Pointers and buffer overflows!
- Arrays of pointers
argc
andargv
parameters formain
(another array-of-pointers example- Pointers and
struct
types nullptr
: the null pointer !envp
parameter formain
(example ofnullptr
use)nullptr
access (don't do it!)- Pointer arithmetic
- C-string functions making use of pointer arithmetic
reverse
function making use of pointer arithmetic
- "reverse print" program
- The
simple_vector
data type - Singly-linked lists
- Doubly-linked lists
- Binary search trees