StrArray constructors and basic operations

Web Site  Methods
 
StrArray::StrArray ()

Construct an empty instance of a StrArray object. Initially, the array contains no elements, and its capacity growth factor is set to "default".

Applications and libraries that want to use the StrArray class must have the conditional symbol STR_USE_EXTRAS defined in their configuration file (str_config.h or stdafx.h)

 

 
StrArray::GetSize
 
int GetSize() const

Return the size of the array, represented as a number of elements.  An array that was just created will have a size of 0.

At any given time, the array will have a 'capacity' to hold at least as many elements as it contains.  The capacity can also be bigger than the current size, depending on the array growth factor and whether the array previously contained elements which were then deleted.

 

 
StrArray::GetCount
 
int GetCount() const

Equivalent to GetSize

 

 
StrArray::IsEmpty
 
BOOL IsEmpty() const

Return TRUE if the array currently holds no elements.  Equivalent to the expression GetSize() == 0

 

 
StrArray::GetUpperBound
 
int GetUpperBound() const

Returns the upper bound of the array, i.e. the index of the last element. Equivalent to the expression GetSize() - 1

 

See alsoStrArray class