Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- void swich(int &x, int &y);
- void swich(int &c, int &d) {
- int tmp = 0;
- tmp = c;
- c = d;
- d = tmp;
- }
- int main(int argc, char** argv) {
- int x,y;
- cout<<"Bitte 2 Zahlen durch ein Leerzeichen getrennt eingeben \n";
- cin>>x;
- cin>>y;
- cout<<"Zaheln bevor swich() aufgerufen wird: " << x << " und " << y << "\n";
- cout<<"Swich aufrufen! \n";
- swich(x,y);
- cout<<"Zaheln nachdem swich() aufgerufen wurde: " << x << " und " << y << "\n";
- return 0;
- }
Add Comment
Please, Sign In to add comment