Logo

Programming-Idioms

History of Idiom 117 > diff from v4 to v5

Edit summary for version 5 by :
New Cpp implementation by user [programming-idioms.org]

Version 4

2016-01-13, 14:03:18

Version 5

2016-01-13, 14:05:08

Idiom #117 Get list size

Set n to the number of elements of list x.

Idiom #117 Get list size

Set n to the number of elements of list x.

Code
int n = x.size();
Comments bubble
x is a std::vector.
Doc URL
http://www.cplusplus.com/reference/vector/vector/size/