Compile and run c++ on windows terminal
xxxxxxxxxx
//compile ex_file.cpp and output ex_file.exe
g++ ex_file.cpp -o ex_file.exe
//run ex_file.exe
.\ex_file.exe
xxxxxxxxxx
- To compile : gcc sourcefile_name.c -o outputfile.exe
- To run : outputfile.exe
xxxxxxxxxx
c:\hello>cl /EHsc hello.cpp
Microsoft (R) C/C++ Optimizing Compiler Version 19.10.25017 for x86
Copyright (C) Microsoft Corporation. All rights reserved.
hello.cpp
Microsoft (R) Incremental Linker Version 14.10.25017.0
Copyright (C) Microsoft Corporation. All rights reserved.
/out:hello.exe
hello.obj
xxxxxxxxxx
#include <iostream>
using namespace std;
int main() {
system("DATE");
return 0;
}