next up previous contents index
Nächste Seite: 1.4 Interne Details beim Aufwärts: 1. Das erste Programm Vorherige Seite: 1.2 Das ``Hello World''   Inhalt   Index


1.3 Das ``Hello World'' - Programm in C++

Idee und Struktogramm wie im Abschnitt 1.2

Quelltext (HelloWorld.cc): (siehe HelloWorld.cc)
//	HelloWorld.cc

#include <iostream.h>

main()
{
 cout << "Hello World" << endl;

//	`endl' - new line
}
  • Kommentar bis Zeilenende
  • vordefinierte Klassen und Methoden
  • Beginn Hauptprogramm
  • einfache Anweisung
  • Blockanweisung

Quelltext eingeben und compilieren, Programm ausführen:

0./1.
wie in § 1.2 .
1.
Quellfile editieren.
LINUX> nedit HelloWorld.cc
2.
Quellfile compilieren.
LINUX> g++ HelloWorld.cc
3.
Programm ausführen.
LINUX> a.out         oder
LINUX> ./a.out         oder
WIN98> ./a.exe
Bemerkungen:
Tip zum Programmieren:
Es gibt (fast) immer mehr als eine Möglichkeit eine Idee im Computerprogramm zu realisieren.
$ \Longrightarrow$ Finden Sie Ihren eigenen Programmierstil (und verbessern Sie ihn).
next up previous contents index
Nächste Seite: 1.4 Interne Details beim Aufwärts: 1. Das erste Programm Vorherige Seite: 1.2 Das ``Hello World''   Inhalt   Index
Gundolf Haase 2004-01-15