Skip to content

Instantly share code, notes, and snippets.

@jitpaul
Last active April 27, 2018 06:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jitpaul/ac41500d9b7efe5a0564d824bad48095 to your computer and use it in GitHub Desktop.
Save jitpaul/ac41500d9b7efe5a0564d824bad48095 to your computer and use it in GitHub Desktop.
Shallow--Deep
#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