-
-
Save jitpaul/ac41500d9b7efe5a0564d824bad48095 to your computer and use it in GitHub Desktop.
Shallow--Deep
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <vector> | |
using namespace std; | |
int main() { | |
int* a = new int; | |
int* b = new int; | |
*a = 5; | |
*b = 4; | |
vector<int*> array = { a,b }; | |
vector<int*> array2 = array; | |
*array2[0] = 9; | |
cout << *array[0]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment