Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- using namespace std;
- int main(){
- int a = 5;
- cout<<"value is = "<<a<<endl;
- cout<<"Address of a is = "<<&a<<endl;
- cout<<"Value of a is = "<<*(&a)<<endl;
- int b = 10; // b is an integer means &b is address of b
- int *c = &b; // *c as a whole is an integer means c is some address of *c
- //c = &b;
- cout<<"b = "<<b<<endl;
- cout<<"*c = "<<*c<<endl;
- b = 6;
- cout<<"*c = "<<*c<<endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement