LoginSignup
0
0

More than 5 years have passed since last update.

[Summary] what is the difference between .cc and .cpp??

Last updated at Posted at 2018-03-31

Some guy said that it doesn't matter when we compile it, any of them will be recognised as C++ file.
But thing is we should make a rule for it when we work on certain scale of project.
So I found nice answer to my Q here on Stackoverflow.

Link: https://stackoverflow.com/questions/1545080/c-code-file-extension-cc-vs-cpp

GNU GCC recognises all of the following as C++ files, and will use C++ compilation regardless of whether you invoke it through gcc or g++: .C, .cc, .cpp, .CPP, .c++, .cp, or .cxx.
Note the .C - case matters in GCC, .c is a C file whereas .C is a C++ file (if you let the compiler decide what it is compiling that is).
GCC also supports other suffixes to indicate special handling, for example a .ii file will be compiled as C++, but not pre-processed (intended for separately pre-processed code). All the recognised suffixes are detailed at gcc.gnu.org

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0