.CC

CC File

C++ Source Code File
Ask a question
QUICK ANSWER

A CC file is C++ source code written in plain text. Open it in any text editor to read or edit the code. To run it, compile it with a C++ compiler such as GCC (g++), Clang, or Visual Studio -- the file does nothing on its own until compiled.

Developer: Bjarne Stroustrup / Bell Labs (C++ language); standardized by ISO/IEC Category: Developer Files Open standard MIME: text/x-c++src
OPENS ON Windows macOS Linux
Related: .DO · .MD · .HEX · .XSD

On this page

19k+ extensions indexed
Last reviewed Aug 2, 2026

Not sure what your file is?

Drop any file into our identifier - we read just the first bytes to name the format.

Identify a file

What is the CC file format?

A .cc file is a plain-text C++ source code file. It contains human-readable C++ code, including preprocessor directives such as #include and #define, namespace declarations, class definitions, and function bodies. The .cc extension is functionally identical to .cpp - both hold C++ source code - but .cc is the convention favored by the GNU toolchain and Google's C++ Style Guide, while .cpp is standard in Windows and Visual Studio projects.

To produce a runnable program, a .cc file must be compiled. On Linux and macOS, the typical commands are g++ file.cc -o output or clang++ file.cc -o output. On Windows, MSVC (cl.exe) and MinGW-w64 also accept .cc files, though .cpp is more common there by convention.

The file is pure ASCII or UTF-8 text with no binary signature or magic bytes. An optional UTF-8 BOM (EF BB BF) may appear at offset 0 but is rarely used and not required. Files typically open with comment blocks, #include directives (e.g., #include <iostream>), and then class or function definitions.

The C++ language standard targeted by the code - C++11, C++17, C++20, or C++23 - is selected at compile time via a flag such as --std=c++23, not embedded in the .cc file itself. Associated declarations are usually kept in a paired .hh or .hpp header file. Compilation produces a .o object file (Linux/macOS) or .obj (Windows), which is then linked into a final executable or library.

Security & safety

RISK: LOW

A .cc file is plain text and cannot run on its own, so opening one in an editor is safe. The risk appears only when you COMPILE and RUN unknown C++ code: source from an untrusted origin can do anything a program can once built (delete files, network access, install malware), and C++'s low-level nature makes malicious or buggy code easy to hide. Read code before compiling it, build untrusted code in a sandbox/VM, and never run a compiled binary you don't trust. The extension itself carries no exploit - the danger is in what the code does after compilation.

Format details

in a nutshell
FULL NAMEC++ Source Code Fileaka C++ source file, cc source file
DEVELOPERBjarne Stroustrup / Bell Labs (C++ language); standardized by ISO/IECsince C++ created 1983 (Bell Labs); standardized ISO C++98 (1998); latest C++23. The .cc extension is a long-standing C++ convention (notably GNU and Google style)
MIME TYPEtext/x-c++src
TYPEPlain-text programming source code (C++ language)
STANDARDOpen · royalty-free
This extension is also used by…
  • Cult3D Designer scene (legacy) - Cycore's Cult3D used .cc as an exported interactive 3D scene; the toolchain is long discontinued and the C++ source meaning dominates today.
  • GNU/Unix C++ convention vs .cpp - Both .cc and .cpp denote C++ source; .cc is favored by GNU and Google style guides, .cpp by Windows/Visual Studio - same language, different convention.

Programs that open CC files

Windows4 apps
Microsoft Visual Studio Freemium Add the .cc to a C++ project and press Build/Run; the free Community edition includes the MSVC compiler.
Notepad Open-source Open the .cc to read/edit with C++ syntax highlighting (viewing/editing only - no compiler).
Visual Studio Code Free Open the .cc for syntax-highlighted editing; add the C/C++ extension + a compiler (MSVC or MinGW g++) to build and debug.
MinGW-w64 / g++ Open-source Command line: 'g++ main.cc -o main.exe' then run main.exe. The standard free Windows C++ compiler.
macOS2 apps
Xcode (Apple Clang) Free Open in Xcode, or use the bundled Clang from Terminal: 'clang++ main.cc -o main && ./main'.
Visual Studio Code Free Edit the .cc with the C/C++ extension; compile with the Clang command-line tools installed via Xcode.
Linux3 apps
GCC / g++ (GNU Compiler Collection) Open-source Compile from a terminal: 'g++ main.cc -o main && ./main'. Pre-installed or one package away on every distro.
GNU Emacs / Vim Open-source Open the .cc in the terminal editor to read/edit with C++ highlighting; pair with g++/make to build.
Visual Studio Code Free Cross-platform editor with the C/C++ extension; edits, builds (via g++/clang) and debugs .cc files.

Technical details

deep spec
MIME typetext/x-c++src (also accepted: text/x-c++, text/plain)
File encodingPlain text - ASCII or UTF-8; optional UTF-8 BOM (EF BB BF) at offset 0
Binary signature (magic bytes)None - plain text file with no fixed byte sequence; identified by extension or content patterns
Typical file sizeA few KB to tens of KB per source file; large codebases may have individual files reaching hundreds of KB
Line endingsLF (Unix/Linux/macOS convention) or CRLF (Windows)
Compilation requiredYes - a .cc file is source only; must be compiled with g++, clang++, or MSVC before it can be executed
Common compilersGCC (g++), Clang (clang++), MSVC (cl.exe), MinGW-w64
C++ standard targetsC++98 through C++23; standard selected by compiler flag (e.g., -std=c++17 or /std:c++20), not stored in the file
Extension conventionFavored by GNU toolchain and Google C++ Style Guide; .cpp is the Windows / Visual Studio convention for identical content
Preprocessor directives#include, #define, #ifdef/#ifndef, #pragma and other C preprocessor directives typically appear at the top of the file
Associated header filesPaired with .hh or .hpp headers; the .cc implementation file pulls in declarations via #include
Compiled outputCompiled to a .o object file (Linux/macOS) or .obj (Windows); subsequently linked into an executable or static/shared library
Language features supportedClasses, templates, exceptions, STL containers, RAII, lambda expressions, constexpr, and concepts (C++20+)
Build system integrationListed as a source in Makefile, CMakeLists.txt (CMake), BUILD (Bazel), or meson.build files
Interchangeability with .cpp.cc and .cpp are functionally identical C++ source extensions; most compilers accept both; the choice is purely stylistic
ReleasedC++ created 1983 (Bell Labs); standardized ISO C++98 (1998); latest C++23. The .cc extension is a long-standing C++ convention (notably GNU and Google style)
Latest versionISO/IEC 14882:2023 (C++23)
Open standardYes · royalty-free
Specificationwww.iso.org

CC conversions

Community Q&A

asked by users
Ask a quick question
Get help from people who work with CC files. Be specific - include your system and software version.
No account needed · answers usually within a day

No questions yet - be the first to ask about CC files.

Frequently asked questions

What is a .cc file?
It's C++ source code in plain text - the same as a .cpp file, just a different extension convention used by GNU and Google-style projects. You read/edit it in a text editor and compile it with a C++ compiler.
What's the difference between .cc and .cpp?
None in meaning - both are C++ source. .cc is favored by GNU and Google style guides; .cpp by Windows/Visual Studio. Every C++ compiler accepts either, and you can rename one to the other freely.
How do I open a .cc file?
To read or edit it, open it in any text/code editor - VS Code, Notepad++, Vim or Xcode give C++ syntax highlighting. It's just text, so even Notepad works for viewing.
How do I compile and run a .cc file?
Install a C++ compiler. On Windows: 'g++ main.cc -o main.exe' (MinGW) then run it, or build in Visual Studio. On macOS/Linux: 'g++ main.cc -o main && ./main' (or clang++).
How do I turn a .cc file into an .exe?
You compile it, not convert it. With g++: 'g++ program.cc -o program.exe'. In Visual Studio, add the .cc to a project and press Build - the .exe is the compiler's output.
Is a .cc file C or C++?
C++. Pure C source uses .c; .cc means C++ (as do .cpp/.cxx). Don't confuse it with the .c extension - compilers pick the C++ language mode from .cc.

References

1ISO/IEC - C++ programming language standard (C++23)www.iso.org
2GCC - GNU Compiler Collection (g++)gcc.gnu.org

Keep exploring

across the database

Top extensions this week

1.AQQAQQ Instant Messenger File
2.CRDOWNLOADChrome Partial Download File
3.PARTPartial Download File
4.DATProgram Data File (generic)
5.EXEWindows Executable (Portable Executable)
6.BINCD/DVD Disc Image (BIN/CUE)
7.NOMEDIAAndroid No-Media Marker File
8.MDMarkdown Document
9.TMPTemporary File
10.RPMSGRestricted Permission Message

Related extensions

.DOStata Do-File
.MDMarkdown Document
.HEXIntel HEX File
.XSDXML Schema Definition
.MAPSource Map (JavaScript / CSS)
.CONFIGConfiguration File

Free file tools

An in-browser file identifier and image converter - everything runs on your device.

Open the toolbox

Browse file extensions A-Z