[#BloombergLP-bdlc-BitArray-setLength]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlc.adoc[bdlc]::xref:BloombergLP/bdlc/BitArray.adoc[BitArray]::setLength
:relfileprefix: ../../../
:mrdocs:

Set the number of bits in this array to the specified `newLength`&period; If `newLength &lt; length()`, bits at index positions at or above `newLength` are removed&semi; otherwise, any new bits (at or above the current length) are initialized to the optionally specified `value`, or to 0 if `value` is not specified&period;

== Synopsis

Declared in `&lt;bdlc&lowbar;bitarray&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
setLength(
    std::size&lowbar;t newLength,
    bool value = false);
----


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