IGOS Nusantara dan C Plus Plus: Perbedaan revisi
Dari IGNwiki
Baris 7: | Baris 7: | ||
== Contoh Program == | == Contoh Program == | ||
Simpan di /home/igos/cpp/coba.cpp | Simpan di /home/igos/cpp/coba.cpp | ||
+ | |||
+ | $ | ||
+ | mkdir /home/igos/cpp/ | ||
+ | cd /home/igos/cpp | ||
+ | nano coba.cpp | ||
+ | |||
+ | Ketik: | ||
#include <iostream> | #include <iostream> |
Revisi per 27 Agustus 2014 01.18
Daftar isi
Pasang
Lakukan
# yum -y install gcc-c++
Contoh Program
Simpan di /home/igos/cpp/coba.cpp
$ mkdir /home/igos/cpp/ cd /home/igos/cpp nano coba.cpp
Ketik:
#include <iostream> int main() { std::cout << "Halo Dunia!" << std::endl; return 0; }
Kompilasi coba.cpp
$ g++ coba.cpp -o hasil
Jalankan
$ ./hasil Hello world!