4 ms·
Is that something people do? I have never seen a C++ file with a .c extension. I have seen plenty of C++ headers with .h extension, though.
by Ballas 5y ago
Is that something people do? I have never seen a C++ file with a .c extension. I have seen plenty of C++ headers with .h extension, though.
- hvdijk 5y agoThis is about C++ files with a .C extension, not a .c extension.
- rfoo 5y agoI think it meant uppercase .C instead of lowercase .c as a C++ extension. Indeed it's pretty rare. That being said, there are indeed projects using lowercase .c extension for their "C++" file: gdb [1][2] [1] https://github.com/bminor/binutils-gdb/blob/3e5fac07975a310c90772e59c17955b4137cc49b/gdb/macroscope.c#L38 https://github.com/bminor/binutils-gdb/blob/3e5fac07975a310c... [2] https://github.com/bminor/binutils-gdb/blob/master/gdbsupport/gdb_unique_ptr.h#L47:28 https://github.com/bminor/binutils-gdb/blob/master/gdbsuppor...
- Ballas 5y agoI see, thanks for clearing that up. (I have obviously also not seen the uppercase .C used before.)
- jcranmer 5y agogcc does as well. The use of .c for a C++ file is probably a project that decided, decades later, to switch from C to C++ and didn't want to go through the hassle of renaming all of their source code files to reflect the language switch.