create an empty project
create a new cpp file
save it as c-file (with c extention)
remove cpp file from the project
add c-file to project
check in the option that the compiler is used according to the extention instead of C++ always

after that the code in c-files will be compiled as C