Is there a reason Google uses the cc extension instead of cpp in its open source projects?

Is there a reason Google uses the cc extension instead of the standard cpp in its open source projects? Should I do this?

+5
source share
5 answers

This is a completely personal preference, at least for the person (s) starting the project. Whatever you choose, be consistent.

+7
source

There are 4 main extensions in the C ++ source code:

  • .C (uppercase C)
  • .cpp
  • .cxx
  • .cc

Choose the one that best suits you and expect that you will have to solve problems on some other platforms.

, , . Windows, MacOS X ( ) , , . , "file.c" "file.c" (, , "file.c" ) .

Google, Google.

+7

. . ".cpp", ".cxx", ".cc" ".C" - ++ ( ".C", , -, , Mac OS X Windows). , ".h" ".pp" ++. ".cpp" ".h" , , . , (, ".hpp" Boost).

+4

There is no standard extension for C ++ source files. There are some widely used extensions, but you can use any that you want if your toolbox supports it (I don’t know one that does not). You can publish all your source files in C ++ using .html if you want.

+2
source

Typing.cc is quite a bit simpler than .cpp, and for all other purposes they are equivalent. So yes.

-2
source

All Articles