#include <iostream>
using namespace std;
void swapr(int & a; int & b);
void swapp(int * p; int * q);
void swapv(int a; int b);
int main()
{
int wallet1=300;
int wallet2=350;
cout << "penazanka1 = " << wallet1 << " sk";
cout << "penazanka2 = " << wallet2 << " sk\n";
cout << "Pouzitie odkazu na vymenu obsahu:\n";
swapr(wallet1, wallet2);
cout << "penazanka1 = " << wallet1 << " sk";
cout << "penazanka2 = " << wallet2 << " sk\n";
cout << "Pouzitie ukazovatela na vymenu obsahu:\n";
swapp(&wallet1, &wallet2);
cout << "penazanka1 = " << wallet1 << " sk";
cout << "penazanka2 = " << wallet2 << " sk\n";
cout << "Pokus pouzitia predania hodnoty:\n";
swapv(wallet1, wallet2);
cout << "penazanka1 = " << wallet1 << " sk";
cout << "penazanka2 = " << wallet2 << " sk\n";
while(cin.get()!='\n');
while(cin.get()!='\n');
return 0;
}
void swapr(int & a; int & b)
{
int temp;
temp = a;
a=b;
b= temp;
}
void swapp(int * p; int * q)
{
int temp;
temp = *p;
*p = *q;
*q = temp;
}
void swapv(int a; int b)
{
int temp;
temp=a;
a=b;
b=temp;
}
kde je chyba??? vypis je z knihy mistrovstvi C++ 8.4