Advertisement
Pafnytiu

Передача в подпрограмму

Jan 21st, 2016
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. #include<iostream>
  2. #include<cmath>
  3. using namespace std;
  4. void Func(int x, int &y,int *z)
  5. {
  6. x += 1;
  7. y += 1;
  8. *z += 1;
  9. cout << "func: \t" << x << "\t" << y << "\t" << *z << endl;
  10. }
  11. int main()
  12. {
  13. int a = 1, b = 2, c = 3;
  14. cout << "main: \t" << a << "\t" << b << "\t" << c << endl;
  15. Func(a, b, &c);
  16. cout << "main: \t" << a << "\t" << b << "\t" << c << endl;
  17. system("pause");
  18. return 0;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement