C++ Formatter

Beautify C/C++ code with proper indentation and brace placement.

About C++ Formatter

C++ formatting is highly debated. Common styles: LLVM (2-space indent, brace on same line), Google (2-space, K&R braces), Mozilla (4-space), WebKit. clang-format is the universal tool — configure it with a .clang-format file at your project root. It supports all major styles and can be customised extensively. Most modern C++ projects use clang-format in CI to enforce style automatically.

FAQ

Which C++ style should I use?
For most projects, LLVM or Google style via clang-format is a safe choice. Games industry often uses custom styles. Embedded C typically follows MISRA-C guidelines with stricter rules. The most important thing is consistency — pick any style and enforce it automatically with clang-format rather than relying on manual compliance.