Mit folgender Funktion lassen sich Konsolen Befehle aus einem C++/C Programm aus starten:
#include <iomanip> #include <iostream> #include <cstdlib> using namespace std; bool startExternalProgramm(char* terminalCommando) { bool returnVal = false; if(terminalCommando != "") { cout << "Executing terminal command: " << terminalCommando << endl; int systemReturn = system(terminalCommando); if (systemReturn == 0) { returnVal = true; } else { cout << "The value returned from Terminal was: " << systemReturn << endl; cout << "Sorry,commando for terminal not executable" << endl; } } else { cout << "Sorry, empty commando for terminal" << endl; } return returnVal; }