|
Resizes the valarray to contain count
elements and assigns value
to each element.
This functions invalidates all pointers and references to elements in the array.
Parameters
count | - | new size of the container |
value | - | the value to initialize the new elements with |
Return value
(none).
Example
1 2 3 4 5 6 7 8 9 | #include <valarray> #include <iostream> int main() { std::valarray< int > v{1,2,3}; v.resize(10); for ( int n: v) std::cout << n << ' ' ; std::cout << '\n' ; } |
Output:
1 | 0 0 0 0 0 0 0 0 0 0 |
See also
returns the size of valarray (public member function) |
Please login to continue.