.cpp C++ source code
Text & source code
| MIME type | text/x-c++src |
|---|---|
| Description | C++ source code |
| Category | Text & source code |
| Based on | text/x-csrc |
| Other extensions | .c, .c++, .cc, .cxx |
Frequently asked questions
What is a .cpp file?
A .cpp file is a “C++ source code” (MIME type text/x-c++src).
How do I open a .cpp file?
With any text editor – Notepad++, Visual Studio Code, or gedit and vim on Linux. The file contains readable text, possibly source code or configuration.
How can you tell a genuine .cpp file?
No fixed signature at the start of the file is registered for this format; it is recognised mainly by its extension. On Linux and macOS, file --mime-type example.cpp shows the guessed type.
Which format is .cpp based on?
Technically a .cpp file is a subtype of “C source code” (text/x-csrc), so programs for that base format can often read it too.
Which MIME type belongs to .cpp?
The MIME type is text/x-c++src. In the Apache web server: AddType text/x-c++src .cpp; in nginx: types { text/x-c++src cpp; }.