StrInitFromStr

Table of Contents

StrInitFromStr

Description

Initialize a Str object using another one

Usage example (Cross-references)

    ///
    #define StrInitFromStr(str) StrInitFromCstr((str)->data, (str)->length)
    #define StrDup(str)         StrInitFromStr(str)
    
    ///
    // Test StrInitFromStr function
    bool test_str_init_from_str(void) {
    printf("Testing StrInitFromStr\n");
    
    Str src = StrInitFromZstr("Hello, World!");
    
    Str src = StrInitFromZstr("Hello, World!");
    Str dst = StrInitFromStr(&src);
    
    // Validate both strings

Share :