C files renamed to C++ are going to be compilable with C++ compilers after renaming?
So I have 25 C files and 1 C++ file I do not want to create Make files or anething like that. I want to turn all that C files into C++ so will simple renaming work or what shall I do?
C files renamed to C++ are going to be compilable with C++ compilers after
Share
In general, yes. You will have to worry about variables named
classand such, thesizeofa character literal, and name mangling, and some other rarely encountered issues. If you’re converting C99 to C++, you’ll have to drop some C99 features.With regards to name mangling, reference any C symbols by using
extern "C". A common idiom is: