Swap two values · Échanger deux valeurs
Swap two values
swap receives pointers to two integers and must exchange their values. Through a pointer, *a reads — or writes — the value it points at. Use a temporary variable so you don't lose one value while copying the other.
Échanger deux valeurs
swap reçoit des pointeurs vers deux entiers et doit échanger leurs valeurs. Via un pointeur, *a lit — ou écrit — la valeur qu'il désigne. Utilisez une variable temporaire pour ne pas perdre une valeur en copiant l'autre.
Complete void swap(int *a, int *b) to exchange the two integers that a and · et b point to. Use the pointers — *a is the value at a. · Complétez void swap(int *a, int *b) pour échanger les deux entiers pointés par a et b. Utilisez les pointeurs — *a est la valeur à a.
Click Run to see the output here. · Cliquez sur Exécuter pour voir le résultat ici.