I am working on a project where half my code is in c and half is in c++.
Now I want to include the cprogram.c in my cppprogram.cpp.
When including a c file inside a c program you can use
#include "cprogram.c"
Anyways to do that in c++ for including a c program.
.cextension). So, in other words, it must be valid C++ as well. However, normally you don't mix things like that and if you mix C and C++ you compile them separately. All that said, you don't ask a question. Please, as a new user here, start with the tour and read How to Ask.#include-ing a .c file in a c++ source file (.cpp/.cxx) is at best a gamble. C and C++ are different languages. There is a chance it will "work" (term used very loosely). You're probably better off incorporating the file properly as a C source, compiled as C target in your build system.