2.2.3.19.36 vectorbase::SetSize

Description

Set the size of the vector

Syntax

BOOL SetSize( UINT nSize, int nGrowBy = -1 )

Parameters

nSize
[input] Number of elements in re-sized vectorbase derived object
nGrowBy
[input] Currently not used, users should omit from call to pass default -1

Return

Returns TRUE on successful exit or FALSE on error.

Examples

EX1

void vectorbase_SetSize_ex1()
{
    // Declare vector object
    vector vec;
    // Set its size and fill with some data
    vec.SetSize(361);
    for( int ii = 0; ii < 361; ii++ )
        vec[ii] = cos(ii * PI / 180);
    for (int jj = 0; jj < vec.GetSize(); jj++)
        printf("%f ",vec[jj]);
}

Remark

Dynamically set the size of (number of elements in) a vectorbase derived object.

See Also

vectorbase::GetSize, Dataset::SetUpperBound

Header to Include

origin.h