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