StrPushBackCstr

Table of Contents

StrPushBackCstr

Description

Push an array of chars with given length to the back of this string.

Parameters

NameDirectionDescription
strin,outStr to insert array chars into.
cstrinarray of characters with given length to be inserted.

Success

str

Failure

NULL

Usage example (Cross-references)

    /// FAILURE : NULL
    ///
    #define StrPushBackZstr(str, zstr) StrPushBackCstr((str), (zstr), strlen((zstr)))
    
    ///
    char c2    = low < 10 ? '0' + low : is_caps ? 'A' + (low - 10) : 'a' + (low - 10);
    char cs[3] = {'\\', c1, c2};
    StrPushBackCstr(o, cs, 3);
    }
    vs++;
    // Test StrPushBackCstr function
    bool test_str_push_back_cstr(void) {
    printf("Testing StrPushBackCstr\n");
    
    Str s = StrInitFromZstr("Hello");
    
    // Push a string at the back
    StrPushBackCstr(&s, " World", 6);
    
    // Check that the string was inserted correctly

Share :