Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- void func(int x, int *y, int &z){
- int a = 1;
- int b = 9;
- x = z + a;
- z = a + x;
- y = &x;
- b = a + z;
- cout<<"func x: "<<x<<endl;
- cout<<"func y: "<<*y<<endl;
- cout<<"func z: "<<z<<endl;
- cout<<"func a: "<<a<<endl;
- cout<<"func b: "<<b<<endl;
- }
- int main(){
- int a = 5;
- int b = 6;
- func(a + b, &b, a);
- cout<<"main a: "<<a<<endl;
- cout<<"main b: "<<b<<endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement