home *** CD-ROM | disk | FTP | other *** search
- /* INTRO33.C - Beispiel aus Kapitel 4 der
- Einführung */
-
- #include <stdio.h>
-
- /* das ist der Prototyp von «tausche» */
- void tausche(int *, int *);
-
- int main()
- {
- int x = 5, y = 7;
-
- tausche(&x, &y);
- printf("x ist nun %d und y ist %d.\n", x, y);
-
- return 0;
- }
-
- /* hier ist «tausche» definiert */
- void tausche(int *a, int *b)
- {
- int temp;
-
- temp = *a;
- *a = *b;
- *b = temp;
- }
-