- The
.cpp extension used to refer to C PreProcessor, but is currently often used for C ++. However, I would avoid this because of the older meaning. .c++ pretty obvious, but some people shy away from it, since the plus may be a special character in some shells that you will need to avoid, IIRC..cxx is a "compromise" involving a plus turn of 45 degrees.- I have not seen
.cc very often, YMMV.
But at the end of the day, you can choose any extension that you like, even .c-plus-plus , since the compiler doesn't care. So go with the one you like best. As always with coding, if you are working in an existing project, stick to an already established agreement.
source share