compiling & running

This track uses g++ (GCC) in the examples, but the flags are the same shape for clang++. Every command below assumes a single file called main.cpp in the current directory.
g++ -o main main.cpp | | compile main.cpp into an executable called main |'ccs1'
g++ -Wall -Wextra -std=c++17 -o main main.cpp | | the flags you actually want day to day: all warnings, extra warnings, a pinned language standard |'ccs2'
./main | | run the compiled binary |'ccs3'
g++ -g -O0 -o main main.cpp | | debug build: keep symbols, disable optimization so a debugger's line numbers match the source |'ccs4'
g++ -O2 -o main main.cpp | | release build: turn optimization on once you're done debugging |'ccs5'
g++ *.cpp -o main | | compile every .cpp file in the directory into one binary |'ccs6'

seeing what the compiler is actually doing

Three stages you can inspect independently — useful when a macro expands into something unexpected, or you want to know whether a function actually got inlined.
g++ -E main.cpp > main_prep.txt | | stop after preprocessing (macro expansion, #include splicing) and dump the result |'ccs7'
g++ -S main.cpp | | stop after compiling to assembly; writes main.s |'ccs8'
g++ -fdump-lang-class -c main.cpp | | dump each class's vtable layout to a *.class file — see the Inheritance & Polymorphism page |'ccs9'
Your notes had this as g++ -X c++ a.cppp -o main for compiling a file with a non-standard extension — two typos in one line. The real flag is lowercase -x, and it goes before the file it applies to:
g++ -x c++ notes.txt -o main | | force the compiler to treat notes.txt as C++ source, regardless of its extension |'ccs10'

compile-time checks

static_assert runs at compile time, not runtime — if the condition is false, the build fails with your message instead of the program misbehaving later.

static_assert(sizeof(int) == 4, "this code assumes a 32-bit int");

template <typename T>
struct only_for_small_types {
  static_assert(sizeof(T) <= 8, "T is too large for this container");
};
            

namespaces

A namespace doesn't change how a function or class behaves — it only prevents name collisions between code that would otherwise share a global name. Syntactically it looks like a class, but there's no access control: everything inside is effectively public.

namespace geometry {
  double area(double r) { return 3.14159 * r * r; }
}

namespace physics {
  double area(double base, double height) { return base * height; } // no collision with geometry::area
}

geometry::area(2.0);
using namespace physics;   // avoid this in headers — it defeats the point of the namespace
area(3.0, 4.0);
            

quick build with make

For anything beyond a single file, a minimal makefile beats retyping the g++ command:

CXX      = g++
CXXFLAGS = -Wall -Wextra -std=c++17 -O2
TARGET   = main
SRCS     = $(wildcard *.cpp)

$(TARGET): $(SRCS)
	$(CXX) $(CXXFLAGS) -o $(TARGET) $(SRCS)

clean:
	rm -f $(TARGET)
            
make | | build using the rule above (looks for a file literally named "makefile" or "Makefile") |'ccs11'
make clean | | run the "clean" target |'ccs12'

where to go from here

C++ Fundamentals — types, stack vs. heap, const-correctness.
Pointers & References — the foundation everything else in C++ memory management builds on.

reference

cppreference.com — the definitive language/library reference.
Compiler Explorer — see the assembly your code actually compiles to, across compilers and optimization levels.