Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- int *x;
- *x = 10;
- cout << "When int* x = 10:\n";
- cout << x << endl;
- cout << *x << endl;
- cout << &x << endl << endl;
- *x = 5;
- cout << "When *x = 5:\n";
- cout << x << endl;
- cout << *x << endl;
- cout << &x << endl << endl;
- int q = &x;
- q = 4;
- cout << "When q = &x and q = 4:\n";
- cout << x << endl;
- cout << *x << endl;
- cout << &x << endl << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment