C-Kurs/(Pointer) Swapping/Musterlösung
< C-Kurs | (Pointer) Swapping
Version vom 24. September 2009, 08:40 Uhr von 130.149.17.39 (Diskussion)
#include <stdio.h> void swap(int *x, int *y) { int t = *x; *x = *y; *y = t; } int main(){ int i= 1; int j= 2; printf("i: %i j: %i\n", i, j); swap(&i, &j); printf("i: %i j: %i\n", i, j); }