std::vector::push_back
cppreference.com
[] |
Google. . , . , . |
<metanoindex/>
<tbody> </tbody> void push_back( const T& value ); |
||
void push_back( T&& value ); |
( C++11) | |
value . size() , capacity(), . , .
| value |
1)
2)
()
.
push_back std::vector<int>
#include <vector>
#include <iostream>
int main()
{
std::vector<int> numbers;
numbers.push_back(42);
numbers.push_back(314159);
for (int i : numbers) { // c++11 range-based for loop
std::cout << i << '\n';
}
return 0;
}
:
42
314159
.
None(C++11) |
(public -) |
| (public -) |