Skip to content

StrPushCstr

StrPushCstr

Description

Push a array of characters with given length into this string at the given position.

Parameters

Name Direction Description
str in,out Str to insert array chars into.
cstr in array of characters with given length to be inserted.
pos in Position to insert at.

Success

str

Failure

NULL

Usage example (Cross-references)

Usage examples (Cross-references)
    // Test StrPushCstr function
    bool test_str_push_cstr(void) {
        WriteFmt("Testing StrPushCstr\n");
    
        Str s = StrInitFromZstr("Hello");
    
        // Push a string at position 2
        StrPushCstr(&s, " World", 6, 2);
    
        // Check that the string was inserted correctly
    /// FAILURE : NULL
    ///
    #define StrPushZstr(str, zstr, pos) StrPushCstr((str), (zstr), strlen(zstr), (pos))
    
    ///
Last updated on