sizeof( vector )

#include #include using namespace std; struct Node { int id; vector score; }; void DisplayVector(vector &v) { cout<<"sizeof(v) = "<::iterator it = v.begin(); it != v.end(); it++) { cout<<*it<<'\t'; } cout<) = "<)<) = "<)<) = "<)<) = "<)<) = "<)<) = "<)<不管插入多少数据,sizeof(vector<>)大小不变,在vc下始终为16,在vs下据说20

你可能感兴趣的:(sizeof( vector ))