可能重复:
Do the parentheses after the type name make a difference with new?
What do the following phrases mean in C++: zero-, default- and value-initialization?C++矢量动初始化
伊夫使用载体而没有任何问题,但还是有疑问的。 我总是用这样的代码,
vector<int>* v1 = new vector<int>;
这样,我可以使用:
vector<int>* v2 = new vector<int>();
我知道什么()做,但什么区别?在v1中,矢量是否曾初始化任何整数?
为什么使用'new'? 'vector v1'有什么问题;'? –
2012-03-03 19:38:42