#include <vector> using namespace std; int main() { int w=1920; int h = 1080; vector<int> dataA( w*h ,0Xff); vector<int> dataB = dataA; int * ptr0 = &dataA[0]; int * ptr1 = &dataB[0]; printf( "%u\n",ptr0 ); printf("%u\n", ptr1); return 0; }
output:
959246464
967577728
两者数据指针地址不同 , 所以是深拷贝!!!