Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstdlib>
- using namespace std;
- void test (int *a)
- {
- *a = (*a)+(*a);
- }
- int main()
- {
- setlocale(0, "");
- cout << "Введите число - ";
- int a;
- cin >> a;
- test (&a); // & - адрес переменной
- cout << "Теперь a = " << a << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement