Что такое формат файла CC?
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.
Безопасность и защита
РИСК: LOWA .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.
Детали формата
в двух словах- 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.
Программы, открывающие файлы CC
Технические подробности
глубокая спецификация| MIME type | text/x-c++src (also accepted: text/x-c++, text/plain) |
| File encoding | Plain 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 size | A few KB to tens of KB per source file; large codebases may have individual files reaching hundreds of KB |
| Line endings | LF (Unix/Linux/macOS convention) or CRLF (Windows) |
| Compilation required | Yes - a .cc file is source only; must be compiled with g++, clang++, or MSVC before it can be executed |
| Common compilers | GCC (g++), Clang (clang++), MSVC (cl.exe), MinGW-w64 |
| C++ standard targets | C++98 through C++23; standard selected by compiler flag (e.g., -std=c++17 or /std:c++20), not stored in the file |
| Extension convention | Favored 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 files | Paired with .hh or .hpp headers; the .cc implementation file pulls in declarations via #include |
| Compiled output | Compiled to a .o object file (Linux/macOS) or .obj (Windows); subsequently linked into an executable or static/shared library |
| Language features supported | Classes, templates, exceptions, STL containers, RAII, lambda expressions, constexpr, and concepts (C++20+) |
| Build system integration | Listed 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 |
| Выпущен | 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) |
| Последняя версия | ISO/IEC 14882:2023 (C++23) |
| Открыть стандартное | Да · без роялти |
| Спецификация | www.iso.org |
Конвертации CC
Вопросы и ответы сообщества
спрошено пользователямиВопросов пока нет - станьте первым, кто спросит о файлах CC.