.CPP File Extension

C++ Source Code File

Developer Standard C++ Foundation
4.1  |  233 Votes
NEW: Open your .CPP file online with File Helper.View Online

What is a CPP file?

A CPP file is a source code file written in C++, a popular programming language that adds features such as object-oriented programming to C. It may be a standalone program containing all the code or one of many files referenced in a development project. CPP files must be compiled by a C++ compiler for the target platform before the code can be run.

More Information

Screenshot of a .cpp file in Microsoft Visual Studio Code 1.54
CPP file open in Microsoft Visual Studio Code 1.54

C++ is one of the most popular programming languages, making CPP files very common among developers. It was created by Bjarne Stroustrup and was first released in 1985 to improve upon the C programming language.

It was initially standardized by the International Organization for Standardization (ISO) in 1998 and has since undergone many improvements. It is maintained by ISO/IEC JTC1 / SC22 / WG21, with the non-profit Standard C++ Foundation providing support for the C++ software developer community.

If you are a programmer, you most likely have worked with CPP files since C++ is used to develop many applications, such as games, web browsers, and database software. Some notable applications written entirely or partially in C++ include Microsoft Office, Adobe Photoshop, MYSQL, Google Chrome, Mozilla Firefox, and Autodesk Maya.

NOTE: C++ source code may also be saved as .C, .CC, and .CXX files, or as .HPP, .H, .HH, or .HXX header files.

Common CPP Filenames

main.cpp - The source code filename typically used for the main() function of a C++ program, where the program begins execution.

How to open a CPP file

You can open and edit CPP files with various source code editors, including Microsoft Visual Studio Code (multiplatform), Code Blocks (multiplatform), and Apple Xcode (macOS). These applications provide syntax highlighting, auto-completion, and other helpful tools that assist you in viewing and editing C++ code.

You can also open and edit CPP files with a plain text editor, such as Microsoft Notepad (bundled with Windows) or Apple TextEdit (bundled with macOS). However, these text editors do not provide helpful source code editing features.

C++ compilers

You can compile the C++ code stored in CPP files to code run on a computer with various free and commercial compilers. Some compilers include Microsoft Visual Studio (Windows), Eclipse IDE for C Developers (multiplatform), GNU Compiler Collection (multiplatform), and Apple Xcode (macOS).

Programs that open CPP files

Verified by FileInfo.com

The FileInfo.com team has independently researched the C++ Source Code file format and Mac, Windows, Linux, and Android apps listed on this page. Our goal is 100% accuracy and we only publish information about file types that we have verified.

If you would like to suggest any additions or updates to this page, please let us know.