Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
AvinandanBose authored Aug 20, 2022
1 parent c826a3e commit 4a4d9e8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ int main()
ptr1 = &i;//Assigning Address of variable i to pointer variable ptr1
ptrptr1 = &ptr1;//Assigning Address of pointer variable ptr1 to Address of Pointer To Pointer's variable ptrptr1
ptrptr2 = ptrptr1;//Assigning Address of Pointer To Pointer's variable ptrptr1 to Address of Pointer To Pointer's variable ptrptr2
ptrptr3 = ptrptr1;//Assigning Address of Pointer To Pointer's variable ptrptr2 to Address of Pointer To Pointer's variable ptrptr3
ptrptr3 = ptrptr2;//Assigning Address of Pointer To Pointer's variable ptrptr2 to Address of Pointer To Pointer's variable ptrptr3
cout<< "ptrptr2(i) = " << **ptrptr2 <<endl;//We get the value of i
cout<< "ptrptr1(i) = " << **ptrptr1 <<endl;//We get the value of i
cout<< "ptrptr1(i) = " << **ptrptr3 <<endl;//We get the value of i
Expand Down
2 changes: 1 addition & 1 deletion ExampleRelatedToPointers_FunctionCallAndRecursion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ int main()
int *ptr1, *ptr2, *ptr3;
ptr1 = &i;//Assigning Address of variable i to pointer variable ptr1
ptr2 = ptr1;//Assigning Address of Pointer Variable(ptr1) to Another(ptr2)
ptr3 = ptr1;//Assigning Address of Pointer Variable(ptr1) to Another(ptr3)
ptr3 = ptr2;//Assigning Address of Pointer Variable(ptr2) to Another(ptr3)
cout<< "ptr_2 (i) = " <<*ptr2 <<endl;//We get the value of i
cout<< "ptr_1(i) = " << *ptr1 <<endl;//We get the value of i
cout<< "ptr3(i) = " << *ptr3 <<endl;//We get the value of i
Expand Down

0 comments on commit 4a4d9e8

Please sign in to comment.