-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtut12.cpp
31 lines (24 loc) · 878 Bytes
/
tut12.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include <iostream>
using namespace std;
int main() {
/* Pointers in C++ */
// int a;
// cout<<"Input a value to find its address: ";
// cin>>a;
// cout<<endl;
// cout<<"******************************************";
// int *b = &a;
// // & ----> (Address of) Operater
// cout<<"The address of a is: "<<&a<<endl;
// cout<<"The address of a is: "<<b<<endl;
// // * ----> (value at) Derefrence Operater
// cout<<"The value at address b is: "<<*b<<endl<<endl;
// // Pointer to Pointer
// // store address of a pointer
// int ** c = &b;
// cout<<"The address of b is: "<<&b<<endl;
// cout<<"The address of b is: "<<c<<endl<<endl;
// cout<<"The value at address c is: "<<*c<<endl;
// cout<<"The value at address value_at(value_at(c)) is: "<<**c<<endl;
return 0;
}