Skip to content

Latest commit

 

History

History
116 lines (93 loc) · 5.65 KB

File metadata and controls

116 lines (93 loc) · 5.65 KB
title CUIntArray Class | Microsoft Docs
ms.custom
ms.date 11/04/2016
ms.reviewer
ms.suite
ms.technology
cpp-windows
ms.tgt_pltfrm
ms.topic reference
f1_keywords
CUIntArray
AFXCOLL/CUIntArray
AFXCOLL/CObArray::CObArray
AFXCOLL/CObArray::Add
AFXCOLL/CObArray::Append
AFXCOLL/CObArray::Copy
AFXCOLL/CObArray::ElementAt
AFXCOLL/CObArray::FreeExtra
AFXCOLL/CObArray::GetAt
AFXCOLL/CObArray::GetCount
AFXCOLL/CObArray::GetData
AFXCOLL/CObArray::GetSize
AFXCOLL/CObArray::GetUpperBound
AFXCOLL/CObArray::InsertAt
AFXCOLL/CObArray::IsEmpty
AFXCOLL/CObArray::RemoveAll
AFXCOLL/CObArray::RemoveAt
AFXCOLL/CObArray::SetAt
AFXCOLL/CObArray::SetAtGrow
AFXCOLL/CObArray::SetSize
dev_langs
C++
helpviewer_keywords
INT
UINT
indexed arrays
arrays [C++], indexed
WORD data type
CUIntArray class
ms.assetid d71f3d8f-ef9f-4e48-9b69-7782c0e2ddf7
caps.latest.revision 23
author mikeblome
ms.author mblome
manager ghogen
translation.priority.ht
cs-cz
de-de
es-es
fr-fr
it-it
ja-jp
ko-kr
pl-pl
pt-br
ru-ru
tr-tr
zh-cn
zh-tw

CUIntArray Class

Supports arrays of unsigned integers.

Syntax

class CUIntArray : public CObject  

Members

The member functions of CUIntArray are similar to the member functions of class CObArray. Because of this similarity, you can use the CObArray reference documentation for member function specifics. Wherever you see a CObject pointer as a function parameter or return value, substitute a UINT.

CObject* CObArray::GetAt( int <nIndex> ) const;

for example, translates to

UINT CUIntArray::GetAt( int <nIndex> ) const;

Public Constructors

Name Description
CObArray::CObArray Constructs an empty array.

Public Methods

Name Description
CObArray::Add Adds an element to the end of the array; grows the array if necessary.
CObArray::Append Appends another array to the array; grows the array if necessary.
CObArray::Copy Copies another array to the array; grows the array if necessary.
CObArray::ElementAt Returns a temporary reference to the element pointer within the array.
CObArray::FreeExtra Frees all unused memory above the current upper bound.
CObArray::GetAt Returns the value at a given index.
CObArray::GetCount Gets the number of elements in this array.
CObArray::GetData Allows access to elements in the array. Can be NULL.
CObArray::GetSize Gets the number of elements in this array.
CObArray::GetUpperBound Returns the largest valid index.
CObArray::InsertAt Inserts an element (or all the elements in another array) at a specified index.
CObArray::IsEmpty Determines if the array is empty.
CObArray::RemoveAll Removes all the elements from this array.
CObArray::RemoveAt Removes an element at a specific index.
CObArray::SetAt Sets the value for a given index; array not allowed to grow.
CObArray::SetAtGrow Sets the value for a given index; grows the array if necessary.
CObArray::SetSize Sets the number of elements to be contained in this array.

Public Operators

Name Description
CObArray::operator [ ] Sets or gets the element at the specified index.

Remarks

An unsigned integer, or UINT, differs from words and doublewords in that the physical size of a UINT can change depending on the target operating environment. A UINT is the same size as a doubleword.

CUIntArray incorporates the IMPLEMENT_DYNAMIC macro to support run-time type access and dumping to a CDumpContext object. If you need a dump of individual unsigned integer elements, you must set the depth of the dump context to 1 or greater. Unsigned integer arrays cannot be serialized.

Note

Before using an array, use SetSize to establish its size and allocate memory for it. If you do not use SetSize, adding elements to your array causes it to be frequently reallocated and copied. Frequent reallocation and copying are inefficient and can fragment memory.

For more information on using CUIntArray, see the article Collections.

Inheritance Hierarchy

CObject

CUIntArray

Requirements

Header: afxcoll.h

See Also

CObject Class
Hierarchy Chart