in linux just use
int ret=system("myshellscrtipt.sh");
since the return value of the script is the return value of the system function. In Windows I'dont't know wether there is a similar function. If you used the Qt toolkit you could do something like this
QProcess process;
process.start( "yourShellCommand", QStringList( args );
and this would be really cross-platform..