C-Kurs/Call by reference/Musterlösung
< C-Kurs | Call by reference
Version vom 17. September 2009, 01:40 Uhr von 85.179.5.52 (Diskussion) (Die Seite wurde neu angelegt: „ #include <stdio.h> void swap(int *a, int *b) { int c = *a; *a = *b; *b = c; } int main() { int a = 3; int b = 4; printf("a...“)
#include <stdio.h> void swap(int *a, int *b) { int c = *a; *a = *b; *b = c; } int main() { int a = 3; int b = 4; printf("a = %d, b = %d\n", a, b); swap(&a, &b); printf("a = %d, b = %d\n", a, b); return 0; }