1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
// Kapitel 1 - Programm 1 - KOMM.CPP
#include <iostream> /* Das ist die Definitionsdatei für Ströme */
void drucke(const int Wert);
int main()
{
const int START = 3; // Der Wert von START kann nicht verändert werden
const int STOPP = 9; // Der Wert von STOPP kann nicht verändert werden
volatile int MITTE = 6; /* Der Wert von MITTE kann von etwas
verändert werden, das außerhalb dieses
Programmes ist. */
int index; /* Eine normale Variable in C */
for (index = START ; index < STOPP ; index++)
drucke(index);
return 0;
} /* Ende des Programmes */
void drucke(const int Wert)
{
std::cout << "Der Wert des Index ist " << Wert << "\n";
}
// Ergebnis beim Ausführen
//
// Der Wert des Index ist 3
// Der Wert des Index ist 4
// Der Wert des Index ist 5
// Der Wert des Index ist 6
// Der Wert des Index ist 7
// Der Wert des Index ist 8
|
Copyright © 1997, 1998, 2001-2005 Heinz Tschabitscher - Letzte Änderung 13. September 2005
Heinz Tschabitscher - | Datenschutz | Impressum - Kommentare, Kritik, Anregungen, Fragen?