.cpp
Use cautionC++ source code
C++ source. Still dominant in operating systems, game engines, finance, and embedded work where performance matters.
MIME types
- text/x-c++src
Category
code
Aliases
.cc / .cxx
What opens this file
- gcc / clang / MSVC
- CLion
- VS Code + C/C++ extension
How to open by OS
Windows
- MSVC (Visual Studio), MinGW-w64.
Mac
- clang (Xcode Command Line Tools).
Linux
- gcc, clang.
Ios
- Build remotely.
Android
- Android NDK.
Safety notes
- Memory safety is not guaranteed — classic overflow bugs abound. Wire ASAN/UBSAN into CI.
- Older C++ dependencies can ship DoS / RCE exposure; keep the toolchain fresh.
Common mistakes
- Heavy raw-pointer usage leads to leaks and use-after-free. Default to
unique_ptr/shared_ptr. - Signed-integer overflow and other UB bend unpredictably under optimisation — compile with
-fsanitize=undefinedto catch.