C++ source file extension

In VC, cpp is used as the suffix name, and in GCC, C, cc, and cxx are used as the suffix name by default.

.cpp, .h (VS file)
.cc, .h (GCC file)

 

In C:

Header file extension: .h

Source file extension: .c

 

In C++:

Header file extension: .h, .hpp, .hxx

 

Source file extension: .cpp, .cc, .cxx,    .C    .c++

 

Here are the extensions now given under different standards:
Unix: C, cc, cxx, c

GNU C++: C, cc, cxx, cpp, c++

Digital Mars: cpp, cxx

Borland: C++ cpp

Watcom: cpp

Microsoft Visual C++: cpp, cxx, cc

Metrowerks CodeWarrior: cpp, cp, cc, cxx, c++

These things are actually labels. It doesn't matter what they are called for people to see, as long as they can see that they are related to c but also different.

Let me be bold:
c++ is an extension named directly with the name of the language, and cpp is also similar (C Plus Plus),
but some systems may not support putting a plus sign "+" in the file name,
so use x instead of + (you don't Do you think x is like a plus sign that is slanted down...), so there
is cxx and C and cc represent the "enlarged" or "enhanced" version of c.
Of course, the extension C is used under Win system Obviously not suitable because Win is case insensitive system
"test.c" and "TEST.C" are exactly the same file name for Win
but different on Linux/Unix platforms


GCC 中以 .s为后缀的文件,是汇编语言源代码文件
-----------------------------------------------------
GCC文件后缀名:

  .c为后缀的文件,C语言源代码文件; 
  .a为后缀的文件,是由目标文件构成的档案库文件; 
  .C,.cc或.cxx 为后缀的文件,是C++源代码文件; 
  .h为后缀的文件,是程序所包含的头文件; 
  .i 为后缀的文件,是已经预处理过的C源代码文件; 
  .ii为后缀的文件,是已经预处理过的C++源代码文件; 
  .m为后缀的文件,是Objective-C源代码文件; 
  .o为后缀的文件,是编译后的目标文件; 
  .s为后缀的文件,是汇编语言源代码文件; 
  .S为后缀的文件,是经过预编译的汇编语言源代码文件。

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325912875&siteId=291194637