Compile C code from char array or std::string?

Hi can anyone help me compile c code from a char array or std::string?

Ive looked around but no luck.

Thanks. Any info would be great.