string::GetBytes

Description

Copy the characters of this string into a byte vector

Syntax

BOOL GetBytes( vector<byte> & vb )

Parameters

vb
[output] vector of bytes to receive the characters from this string

Return

Returns TRUE if success,otherwise FALSE

Examples

EX1

void string_GetBytes_ex1()
{
    string str = "ABCD";
    vector<byte> vResult;
    str.GetBytes(vResult);       //Copy str into vResult

    for(int ii=0; ii<vResult.GetSize(); ii++)
                printf("%c", vResult[ii]);      //Should print "ABCD"
}

Remark

See Also

vectorbase::GetBytes

Header to Include

origin.h