how to run c++ on cmd code example
Example 1: run cmd command c++
#include <iostream>
using namespace std;
int main() {
system("DATE");
return 0;
}
Example 2: c++ compile to exe command line
gcc sourcefile_name.c -o outputfile.exe
#include <iostream>
using namespace std;
int main() {
system("DATE");
return 0;
}
gcc sourcefile_name.c -o outputfile.exe