Skip to content

Instantly share code, notes, and snippets.

@ymurase
Created December 25, 2014 13:13
Show Gist options
  • Save ymurase/536234542c5ee96a0c6e to your computer and use it in GitHub Desktop.
Save ymurase/536234542c5ee96a0c6e to your computer and use it in GitHub Desktop.
call system from c++
#include <iostream>
int main(int argc, char* argv[]) {
std::cout << "starting..." << std::endl;
system("ls");
std::cout << "ls done" << std::endl;
std::cout << "running: " << argv[1] << std::endl;
system(argv[1]);
std::cout << "finished" << std::endl;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment