Hi, @lkq1994 ,
From an IDE perspective - files ending .c and .cpp may be treated differently. Usually in the settings for build, there are settings for the C compiler and settings for the C++ compiler.
From a programming perspective, yes, C and C++ may be mixed but any references to routines compiled as C code need to be guarded with extern "C" declarations. extern "C" tells the C++ compiler to not "mangle", that is, decorate the function or symbol name in any way. That way, the name of the C symbol is preserved exactly as the programmer wrote it and the C++ code will reference the C code by its "unmangled" name.
Plus, you can find many article and information about C and C++ programming on eclipse platform with Google search, that may be helpful.
Hope you find the information helpful.
Thank you. Best regards.
- Mehul Patel
Hi, @lkq1994 ,
Please let us know if you required further help or guidance.
Thank you. Best regards.
- Mehul
Hi, @lkq1994 ,
From an IDE perspective - files ending .c and .cpp may be treated differently. Usually in the settings for build, there are settings for the C compiler and settings for the C++ compiler.
From a programming perspective, yes, C and C++ may be mixed but any references to routines compiled as C code need to be guarded with extern "C" declarations. extern "C" tells the C++ compiler to not "mangle", that is, decorate the function or symbol name in any way. That way, the name of the C symbol is preserved exactly as the programmer wrote it and the C++ code will reference the C code by its "unmangled" name.
Plus, you can find many article and information about C and C++ programming on eclipse platform with Google search, that may be helpful.
Hope you find the information helpful.
Thank you. Best regards.
- Mehul Patel