Advertisement
Guest User

smt

a guest
Aug 21st, 2019
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.47 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. void func(int x, int *y, int &z){
  6.     int a = 1;
  7.     int b = 9;
  8.     x = z + a;
  9.     z = a + x;
  10.     y = &x;
  11.     b = a + z;
  12.     cout<<"func x: "<<x<<endl;
  13.     cout<<"func y: "<<*y<<endl;
  14.     cout<<"func z: "<<z<<endl;
  15.     cout<<"func a: "<<a<<endl;
  16.     cout<<"func b: "<<b<<endl;
  17. }
  18.  
  19. int main(){
  20.     int a = 5;
  21.     int b = 6;
  22.     func(a + b, &b, a);
  23.     cout<<"main a: "<<a<<endl;
  24.     cout<<"main b: "<<b<<endl;
  25.     return 0;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement