网站首页  词典首页

请输入您要查询的计算机术语:

 

术语 CObArray::GetUpperBound
释义 CObArray::GetUpperBound

int GetUpperBound( ) const;

返回值:返回以0为基数的上界的索引。

说明:
返回该数组的当前上界。由于数组索引以0为基数,那么该函数返回值将比GetSize返回值小1。
条件 GetUpperBound( ) ==1指出的是数组没有元素。
下表列出了类似于CObArray::GetUpperBound函数的其它成员函数。
成员函数
CByteArrayint GetUpperBound( ) const;
CDWordArrayint GetUpperBound( ) const;
CPtrArrayint GetUpperBound( ) const;
CStringArrayint GetUpperBound( ) const;
CUIntArrayint GetUpperBound( ) const;
CWordArrayint GetUpperBound( ) const;

示例:
请参阅CObList::CObList,了解所有收集示例中使用的CAge类。
// example for CObArray::GetUpperBound
CObArray array;
array.Add( new CAge( 21 ) ); // Element 0
array.Add( new CAge( 40 ) ); // Element 1
ASSERT( array.GetUpperBound() == 1 ); // Largest index

请参阅:CObArray::GetSize, CObArray::SetSize
随便看

 

MFC类库中文详解手册包含4274条MFC类库参考词条,基本涵盖了Microsoft基本类库中的类、全局函数、全局变量和宏的内容,是计算机编程的有利工具。

 

Copyright © 2004-2023 Winrtm.com All Rights Reserved
京ICP备2021023879号-40 更新时间:2024/10/6 12:33:25