StrPushCstr
- Macro
- August 22, 2025
Table of Contents
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)
- In
Insert.h:91
:
/// FAILURE : NULL
///
#define StrPushZstr(str, zstr, pos) StrPushCstr((str), (zstr), strlen(zstr), (pos))
///
- In
Str.Insert.c:108
:
// Test StrPushCstr function
bool test_str_push_cstr(void) {
printf("Testing StrPushCstr\n");
Str s = StrInitFromZstr("Hello");
- In
Str.Insert.c:113
:
// Push a string at position 2
StrPushCstr(&s, " World", 6, 2);
// Check that the string was inserted correctly