home *** CD-ROM | disk | FTP | other *** search
- // ex3.cpp: Inline-Funktionen
- // aus Kapitel 6 der Einführung
-
- #include <iostream.h>
-
- const float Pi = 3.1415926;
-
- inline float area(const float r)
- { return Pi * r * r;
- }
-
- main()
- {
- float radius;
-
- cout << "Geben Sie den Radius eines Kreises "
- "an: ";
- cin >> radius;
- cout << "Die Fläche beträgt " << area(radius)
- << "\n";
- }
-