Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- /////////////////////////////////
- int main() //
- {
- setlocale(LC_ALL, "rus");
- int n = 9;
- int *p = &n;
- p = new int;
- *p = 421;
- cout <<"Size of *p = " << sizeof *p << endl;
- cout <<" p = " << p << endl;
- cout <<" *p = " << *p << endl;
- int &r = *p;
- cout <<" r = " << r << endl;
- cout <<" &r = " << &r << endl;
- cout <<"Address n = " << &n << endl;
- cout <<"Address p = " << &p << endl;
- delete p;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement