OriginLab Corporation - Data Analysis and Graphing Software - 2D graphs, 3D graphs, Contour Plots, Statistical Charts, Data Exploration, Statistics, Curve Fitting, Signal Processing, and Peak Analysis                     
 
Skip Navigation Links
All BooksExpand All Books
Origin CExpand Origin C
Origin C ReferenceExpand Origin C Reference
ClassesExpand Classes
Composite Data TypesExpand Composite Data Types
stringExpand string

2.2.3.11.14 string::GetLength

Description

Return the number of bytes (or number of characters) in this string object. The count does not include a null terminator.

Syntax

int GetLength( )

Parameters

Return

An integer value equal to the length (number of bytes minus the null character) of this string.

Examples

EX1

void string_GetLength_ex1()
{
    string str( "cow" );
    int nRet = str.GetLength();
    out_int("", nRet);//3
    
    str.Empty();
    nRet = str.GetLength();
    out_int("", nRet);//0
}

Remark

See Also

Header to Include

origin.h

 

© OriginLab Corporation. All rights reserved.