This post shows how to execute a C++ hello world program with the following steps:
1. In terminal, create a C++ file called hello.cpp:
nano hello.cpp
2. Edit the hello.cpp file as:
#include <iostream>
using namespace std;
int main() {
cout << "Hello, World!\n";
return 0;
}
3. In terminal, execute the file with:
g++ hello.cpp
./a.out
Result:
References
Compiling simple Hello World program on OS X via command line (StackOverflow)
C language with Mac: Hello World with Mac's Terminal
Matlab: Run Hello World files in C/C++ with MEX command
This blog is about Apple's Swift programming language with iOS, Xcode, and iPhone.
Related Information: Electrical and Computer Engineering - StudyEECC
Biomedical Engineering -
StudyBME
Python - Study Raspberry Pi
Friday, February 23, 2018
Saturday, February 10, 2018
Subscribe to:
Posts (Atom)