阅读背景:

【C++注意事项】7 Library vector Type

来源:互联网 

List Initializer or Element Count?

In a few cases, what initialization means depends upon whether we use curly braces or parentheses to pass the initializer(s). For example, when we initialize a vector< int > from a single int value, that value might represent the vector’s size or it might be an element value. Similarly, if we supply exactly two int values, those values could be a size and an initial value, or they could be values for a two-element vector. We specify which meaning we intend by whether we use curly braces or parentheses:In a few c




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: