cara menginstall compiler c++ pada linux

ketikkan kode dibawa in

sudo apt-get install g++ 
sudo apt-get install emacs

 

lalu buat folder

ls

mkdir contoh

cd contoh

emacs hello_world.cpp

menulis script c++ nya
contoh
#include <iostream>
using namespace std;
 
int main() { 
 
     cout << "Hello World!\n";
     return 0;
}

Compilingnya
g++ hello_world.cpp
eksekusinya
./a.out

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s