Skip to content

Commands

Compiling

Sanitizers are very useful. Always use them with -g3, which enables debug information. It makes it so you can instantly know which line is causing your runtime error.

g++ -Wall -Wextra -Wconversion -g3 -O3 -fsanitize=address,undefined a.cpp -o a

Valgrind

valgrind --tool=cachegrind ./a < a.txt
kcachegring kcachegrind cachegrind.out.XXXX

Hashing

Hashes a file, ignoring all whitespace and comments. Use for verifying that code was correctly typed.

cpp -dD -P -fpreprocessed | tr -d '[:space:]'| md5sum | cut -c-6