Portal Informatika | Sharing Tugas | Sharing Aplikasi | Sharing Informasi tentang Teknologi dan Aplikasi

Kamis, 22 November 2012

Aplikasi Sederhana "Hello World!" C++ | Ilham Permana TI112051

Posted by Unknown On 17.15 No comments


C++ Hello World Tutorial

This C++ Hello World tutorial is written for beginning C++ students without previous C++ programming experience. ...

#include <iostream>
using namespace std;
void main()
{
  cout << "Hello World!" << endl;   cout << "Welcome to C++ Programming" << endl; }


#include <iostream> brings in the needed libraries for console output.
using namespace std; keeps you from having to type std::cout each time that output is needed.
void main() is the main function which executes first, before any other code. The word void means that the function does not return anything.
cout << is the output statement and strings need quotation marks.
End the cout line with a semicolon. If you use << endl; do not put a semicolon in the middle of the line. The endl; means that the next cout will have a new output line; this ends the line for this cout statement.

Using the Older VC++ 6.0 Compiler
Students with beginning C++ programming knowledge will learn methods, properties and classes all using the "console". To begin a new C++ project, using VC++ 6:
Select File, New. Click on the Projects tab. Click on the Win32 Console Application. Set the project name and location then click OK. Select the "empty project" radio button.
Now click Finish. (Next dialog box that pops up, just click OK).

Now you will see part of the development environment. Find the top row menu bar and click on Projects. Select "Add to Project", then select "New".

The New dialog box pops up. Click on Files if the File tab is not already active.
With the files tab activated and in front, select the "C++ Source File". Type in a filename then click OK. The flashing cursor will be in a white area and you are ready to begin typing in a C++ console application.

When you have typed in your program, click on the Build menu item in the Working area. Build is on the menu bar. Find the red exclamation mark and click on "execute new_.exe". A window pops up that says "The file does not exist. Do you want to build it?" Select yes. It should link and you should be able to see the console output. If not, you have errors and the lower window will list the errors if you scroll to the top of the lower window of the development environment. Double clicking on an error in the list will point to the code line in question. A pointer shows up near the typed code if you have clicked on an error message. This points to the problem line and the message may not necessarily relate to what the problem really is. Your textbook should have additional information about the compiler you are using in class...if not, please ask your instructor for information about that compiler if it was not provided in the first class session...
Do not attempt to install the VC++ 6 compiler on the XP operating systems. Get a newer Microsoft VC++.NET compiler for the XP operating system. 



Translate (via google translate)


C + + Tutorial Hello World

Ini C + + tutorial Hello World yang ditulis untuk awal C + + siswa tanpa pengalaman sebelumnya C + + programming. ...


# Include
menggunakan namespace std;
void main ()
{
  cout << "Hello World!" << Endl; cout << "Selamat Datang di C + + Pemrograman" << endl;}


# Include membawa di perpustakaan yang dibutuhkan untuk output konsol.
menggunakan namespace std; membuat Anda harus mengetikkan std :: cout setiap kali bahwa output yang dibutuhkan.
void main () adalah fungsi utama yang mengeksekusi pertama, sebelum kode lainnya. Kekosongan kata berarti bahwa fungsi tidak mengembalikan apa-apa.
cout << adalah pernyataan output dan string perlu tanda kutip.
Akhiri garis cout dengan titik koma. Jika Anda menggunakan << endl; tidak menaruh titik koma di tengah baris. The endl; berarti bahwa pengadilan berikutnya akan memiliki garis keluaran baru, ini berakhir baris untuk pernyataan cout.
Menggunakan VC Lama + + 6.0 Compiler

Siswa dengan awal C + + pengetahuan pemrograman akan belajar metode, properti dan kelas semua menggunakan "konsol". Untuk memulai C + + proyek baru, dengan menggunakan VC + + 6:
Pilih File, New. Klik pada tab Proyek. Klik pada Aplikasi Konsol Win32. Mengatur nama dan lokasi proyek kemudian klik OK. Pilih "proyek kosong" tombol radio.
Sekarang klik Finish. (Kotak dialog selanjutnya yang muncul, klik OK).

Sekarang Anda akan melihat bagian dari lingkungan pengembangan. Cari bar baris menu atas dan klik pada Proyek. Pilih "Tambahkan ke Proyek", kemudian pilih "New".

Kotak dialog New muncul. Klik pada File jika tab File yang belum aktif.
Dengan tab file diaktifkan dan di depan, pilih "C + + Sumber file". Ketik nama file lalu klik OK. Kursor akan berkedip di daerah putih dan Anda siap untuk mulai mengetik dalam aplikasi C + + konsol.

Bila Anda telah mengetik dalam program Anda, klik pada item menu Build di daerah kerja. Build adalah pada menu bar. Cari tanda seru merah dan klik "mengeksekusi new_.exe". Sebuah jendela muncul yang mengatakan "File tidak ada Apakah Anda ingin membangunnya?." Pilih yes. Ini harus menghubungkan dan Anda harus dapat melihat output konsol. Jika tidak, Anda memiliki kesalahan dan jendela yang lebih rendah akan daftar kesalahan jika Anda menggulir ke bagian atas jendela yang lebih rendah dari lingkungan pengembangan. Dobel klik pada kesalahan dalam daftar akan menunjuk ke baris kode dalam pertanyaan. Sebuah pointer muncul di dekat kode diketik jika Anda telah mengklik pesan kesalahan. Ini poin ke baris masalah dan pesan tidak mungkin selalu berhubungan dengan apa masalahnya sebenarnya. Buku Anda harus memiliki informasi tambahan tentang compiler yang Anda gunakan di kelas ... jika tidak, silahkan meminta instruktur Anda untuk informasi tentang kompiler bahwa jika itu tidak diberikan dalam sesi kelas ...
Jangan mencoba untuk menginstal VC + + 6 compiler pada sistem operasi XP. Dapatkan Microsoft baru VC + +. NET compiler untuk sistem operasi XP.

0 komentar:

Posting Komentar