Pourquoi sa swap pas?
c1117
-
xav3601 Messages postés 3390 Statut Membre -
xav3601 Messages postés 3390 Statut Membre -
Bonjour,
Je comprend pas pourquoi sa swap pas et vous?
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
void swap (int * a,int * b ) {
int * temp = a;
a=b;
b=temp;
}
int main () {
int i=10,j=20;
swap(&i,&j);
cout << i << ' ' << j;
}
sa affiche 10 20 :-(
Je comprend pas pourquoi sa swap pas et vous?
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
void swap (int * a,int * b ) {
int * temp = a;
a=b;
b=temp;
}
int main () {
int i=10,j=20;
swap(&i,&j);
cout << i << ' ' << j;
}
sa affiche 10 20 :-(
A voir également:
- Pourquoi sa swap pas?
- Swap windows - Guide
- The swap group - Forum Consommation & Internet
- Swap ram - Forum Windows
- Swap magic ✓ - Forum Jeux vidéo
- Hot swap - Forum Matériel & Système