Pas urgent C++
maryouma1986
Messages postés
18
Date d'inscription
Statut
Membre
Dernière intervention
-
maryouma1986 Messages postés 18 Date d'inscription Statut Membre Dernière intervention -
maryouma1986 Messages postés 18 Date d'inscription Statut Membre Dernière intervention -
Bonjour,
j 'ai un examen à passer 2m1 en C++.
voici un code en c++, est ce qu'il y a personne qui peut m'aider quuelle est la sortie de ce programme.
merci d'avance.
voici le code en c++
struct c {
int i;
c(int) {i=5}
c(float) {cout<<17<<' '}
~c() { cout<<43<<' 4}
void operator=(int) {i=7}
int m() {return 11;}
};
struct d: public c{
d():c('a') {}
d(int);c(1.0f){ cout <<19<<' '}
~d() { cout<< 41<<' '}
int m() {return 13;}
int n() const {return 31}
int n() { return 37}
};
{ s<<23<<' ';}
main()
' c x(1);
cout<<"a:"<<x.i<<endl;
c y=2;
cout<<"b:"<<y.i<<endl;
d z;
c &r=z;
cout<< "c:"<<r.m()<<endl;
cout<<"d:"<<d(1)<<endl;
cout<<"e:"<<z.n()<<endl;
}
j 'ai un examen à passer 2m1 en C++.
voici un code en c++, est ce qu'il y a personne qui peut m'aider quuelle est la sortie de ce programme.
merci d'avance.
voici le code en c++
struct c {
int i;
c(int) {i=5}
c(float) {cout<<17<<' '}
~c() { cout<<43<<' 4}
void operator=(int) {i=7}
int m() {return 11;}
};
struct d: public c{
d():c('a') {}
d(int);c(1.0f){ cout <<19<<' '}
~d() { cout<< 41<<' '}
int m() {return 13;}
int n() const {return 31}
int n() { return 37}
};
{ s<<23<<' ';}
main()
' c x(1);
cout<<"a:"<<x.i<<endl;
c y=2;
cout<<"b:"<<y.i<<endl;
d z;
c &r=z;
cout<< "c:"<<r.m()<<endl;
cout<<"d:"<<d(1)<<endl;
cout<<"e:"<<z.n()<<endl;
}
il ne peut pas compilé