Une belle question interview C:Ecrire une fonction qui intervertit deux int * en c et également écrire appel à cette fonction
Pouvez-vous écrire une fonction qui intervertit deux int * en C et écrire aussi un appel à ce fonction?
int a = 10, b = 20;
int* first_pointer = &a;
int* second_pointer = &b;
/* Below line should print (*first_pointer) = 10, (*second_pointer) = 20 */
printf("(*first_pointer) = %d, (*second_pointer) = %d\n",*first_pointer, *second_pointer);
/// **** Call your swap function here ****
/* Below line should print (*first_pointer) = 20, (*second_pointer) = 10 */
printf("(*first_pointer) = %d, (*second_pointer) = %d\n",*first_pointer, *second_pointer);
Quelle est votre solution? – sharptooth
Je ne vois pas de question. – Aistina
@sharptooth: soumis. – SunnyShah