[#BloombergLP-bdlat_ArrayFunctions-resize]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlat_ArrayFunctions.adoc[bdlat&lowbar;ArrayFunctions]::resize
:relfileprefix: ../../
:mrdocs:

Set the size of the specified modifiable `array` to the specified `newSize`&period;

== Synopsis

Declared in `&lt;bdlat&lowbar;arrayfunctions&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class TYPE&gt;
void
resize(
    TYPE* array,
    int newSize);
----

== Description

If `newSize &gt; size(array)`, then `newSize &hyphen; size(array)` elements with default values are appended to `array`&period; If `newSize &lt; size(array)`, then the `size(array) &hyphen; newSize` elements at the end of `array` are destroyed&period; The behavior is undefined unless `0 &lt;&equals; newSize`&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *array*
| array to resize
| *newSize*
| desired number of elements in `array`
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
