Created
February 26, 2017 05:26
-
-
Save sebassdc/2828fd3d8e14f462848dba8b371d50c2 to your computer and use it in GitHub Desktop.
Ahorra tiempo para compilar c++
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ahorra tiempo para compilar c++ | |
#include <cstdlib> | |
#include <iostream> | |
#include <string> | |
using namespace std; | |
int main(int argc, char const *argv[]) { | |
string filename(argv[1]), result, callString; | |
result = filename.substr(0 , filename.length() - 4); | |
callString = "g++ -o "+ result + " " + filename; | |
cout << callString << endl; | |
system(callString.c_str()); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment