Compiling a c source file through c++ code

I have a c++ program in visual studio 2015 , where I get as a input a c++ file,whichI do some changes to it. Afterwards, I want through a c++ code to make visual studio compile this file again.

Is there any way to do this (not through a command line)?