2.1.2.1 append_blanks_to_size


Description

It appends the' ' characters to the string until its size reaches nSize.If the size of the string is bigger than nSize, the function will not append nor modify the original string.

Syntax

void append_blanks_to_size( string & str, int nSize )

Parameters

str
[modify] the string to be appended
nSize
[input] the size of the string after appending.

Return

Examples

EX1

int append_blanks_to_size_ex1()
{
    string strToAppend("To be appended");
    append_blanks_to_size(strToAppend,30);
    printf("After appending the string is:\n%s*the end*\n",strToAppend);
    return 0;
}

Remark

See Also

Header to Include

origin.h

Reference