Is there a way to run programs from C++ so that it executes a command in a linux command prompt?

say I wanted to execute several lines of code in the linux command prompt:

> myprogram.exe
> dot -o run.jpg run.dot
> xemacs file.cc
> ...etc...

and I wanted to do these hypothetical commands by running a C++ file:

> g++ -o runthis.exe runthis.cc
> runthis.exe

What is the syntax that I should use to be able to do this? And is there a way?