C and C ++ are two different languages, however C ++ is a superset of the C language.
So what's the difference between a file with the extension in .c
and .cpp
?
C and C ++ are two different languages, however C ++ is a superset of the C language.
So what's the difference between a file with the extension in .c
and .cpp
?
Nothing computes to be, but by convention, even usually understood by default by some compilers that .c
is C language code files and .cpp
is for C ++. Just as many people use .h
for C ++ header, others prefer .hpp
. There are those who use .cc
for C ++ according to comment below Brumazzi DB, also by pure convention.
Note that C ++ is almost a superset of C, there are some small differences, especially if you consider C11. And even though much of what works in C, it is recommended not to use it in C ++.