1
| sudo apt-get install build-essential |
Bahasa C
- Buat source code C dengan nama file first.c
123456
#includeint main(){printf("hello, world\n");return 0;} - Compile source codenya :
1
cc -c first.c - Buat outputnya :
1
cc -o first first.c - Eksekusi file outputnya :
1
./first - Hasil eksekusi yang akan ditampilkan :
1
Hello, world
- Buat source code C++ first.cpp
123456
#includeint main(){std::cout << "hello world!" << std::endl;return 0;} - Buat file output :
1
g++ first.cpp -o test - Eksekusi file output :
1
./test - Hasilnya :
1
Hello World!
Tidak ada komentar:
Posting Komentar