StrInitFromStr
- Macro
- August 22, 2025
Table of Contents
StrInitFromStr
StrInitFromStr
Description
Initialize a Str object using another one
Usage example (Cross-references)
- In
Init.h:78
:
///
#define StrInitFromStr(str) StrInitFromCstr((str)->data, (str)->length)
#define StrDup(str) StrInitFromStr(str)
///
- In
Str.Init.c:75
:
// Test StrInitFromStr function
bool test_str_init_from_str(void) {
printf("Testing StrInitFromStr\n");
Str src = StrInitFromZstr("Hello, World!");
- In
Str.Init.c:78
:
Str src = StrInitFromZstr("Hello, World!");
Str dst = StrInitFromStr(&src);
// Validate both strings