출처 : http://forums.codeguru.com/showthread.php?397010-What-s-with-*.cxx-files-instead-of-*.cpp
It is probably due to a project using libraries (in form of source code) that don't use the same naming convention the programmer(s) of the project.
There are at least four different extensions usable for C++ files:
- .C
Not very popular since it requires a case-sensitive file system (otherwise, it would clash with old .c file names), and even a few modern OS are not case-sensitive. - .c++
Some OS or file systems don't support the + character in file names. - .cpp
That's very portable across file systems.
But, it might be less consistent than .cxx - .cxx
Very portable across file systems (not more than .cpp)
Using the name CXX for C++ is quite popular because CPP usually designates the C (and C++) pre-processor.
For example, these environment variables/makefile macros- CPPFLAGS
Represents the flags passed to the pre-processor. - CFLAGS
Flags passed to the C compiler. - CXXFLAGS
Flags passed to the C++ compiler. - LDFLAGS
Flags passed to the linker. - CC
The path to the C compiler. - CPP
The path to the pre-processor. - CXX
The path to the C++ compiler. - LD
The path to the linker.
That's why, with the above notations, it's very natural to give the .cxx extension to C++ files. - CPPFLAGS
For headers, there are at least five extensions:
- .h
Traditional C header files.
Since the compiler doesn't do anything based on this extension, it can be used for C++ header files too.
Furthermore, there are a lot of header files that are designed to be included by both C and C++ translation units.
In that case, it's natural to give them this extension. - .H, .hpp or .hxx
That's very natural to give one of these extensions for C++ header files (being consistent with the name of C++ translation units).
That's not a bad idea to use one of these name for pure C++ header files only (containing class definitions, or templates, or any other feature not supported by C). - No extension
That's internally used by a number of C++ compilers for iostream, vector, algorithm and all others new-style C++ headers.
There are probably other (less popular) extensions for headers.
Perhaps .cpp and .i
'Development > C/C++' 카테고리의 다른 글
Visual Studio 2015 Diagnostic Tools (0) | 2016.11.16 |
---|---|
cppcheck를 Visual Studio 외부도구에 통합 (0) | 2015.11.19 |
원격 디버깅 (VS.NET 2003) (0) | 2013.02.27 |
무료 C++ 개발환경(IDE) Dev-C++ (0) | 2013.02.27 |
Visual Studio.NET 2003에서 전처리 결과 소스 확인방법 (0) | 2013.02.27 |
안정적인 DNS서비스 DNSEver
