#include<iostream>
using namespace std;
int main(){
// int a = 5;
int arr[20] = {1, 2, 3, 4, 5, 6};
int *ptr1 = arr; //
int *ptr2 = ptr1 + 3; //4
cout << (ptr2 == arr) << endl;
// yes : true : 1 (ptr1 == arr) OUTPUT- 1 (yes points
to same memory location)
// cout << ptr2 - ptr1 << endl;
return 0;
}
OUTPUT-
0
No comments:
Post a Comment