samedi 26 août 2017

C++ Alias declaration error

int& x=a;int& y=b;
cout<<"Before Swapping by values: "<<endl;
cout<<"A= "<<a<<" B= "<<b<<endl;
swap_reference(x,y);
cout<<"After Swapping by values: "<<endl;
cout<<"A= "<<a<<" B= "<<b<<endl;

I have this code. While Compiling I am getting this error:

crosses initialization of 'int& y'
         case 1: int& x=a;int& y=b;

Aucun commentaire:

Enregistrer un commentaire