After resizing, the array will contain sz elements with a value of c, no matter what the previous content was.
All pointers and references to elements of the valarray are invalidated.
Parameters
- sz
- Size of the valarray, in terms of the number of elements.
size_t is an unsigned integral type. - c
- Value to be assigned to each of the elements of the resized array.
T is the template type of valarray (the elements' type).
Return value
noneExample
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
|
Output:
0 0 0 |
See also
| valarray::size | Return size (public member function) |
| valarray::valarray | valarray constructor (public member function) |
| valarray::operator= | Assign content (public member function) |
