[#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`. If `newLength < length()`, bits at index positions at or above `newLength` are removed; 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. == Synopsis Declared in `<bdlc_bitarray.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- void setLength( std::size_t newLength, bool value = false); ---- [.small]#Created with https://www.mrdocs.com[MrDocs]#