The only standard method is the system function:
#include <cstdlib>
#include <iostream>
int main ( int argc, char *argv[] )
{
if ( argc < 2 ) {
std::cerr<<"Too few arguments"<<std::endl;
return EXIT_FAILURE;
}
// Be ultra-anal
if ( std::system ( 0 ) == 0 ) {
std::cerr<<"No command processor available"<<std::endl;
return EXIT_FAILURE;
}
return std::system ( argv[1] );
}
Reputation Points: 6442
Solved Threads: 1393
Bad Cop
Offline 11,807 posts
since Sep 2004