Skip to content
StrInitFromStr

StrInitFromStr

StrInitFromStr

Description

Initialize a Str object using another one

Usage example (Cross-references)

Usage examples (Cross-references)
            case STR_INIT_FROM_STR : {
                if (VecLen(str) > 0) {
                    Str temp = StrInitFromStr(str);
                    StrDeinit(str);
                    *str = temp;
        }
    
        return StrInitFromStr(value);
    }
    // Test StrInitFromStr function
    bool test_str_init_from_str(void) {
        WriteFmt("Testing StrInitFromStr\n");
    
        Str src = StrInitFromZstr("Hello, World!");
    
        Str src = StrInitFromZstr("Hello, World!");
        Str dst = StrInitFromStr(&src);
    
        // Validate both strings
    ///
    #define StrInitFromStr(str) StrInitFromCstr((str)->data, (str)->length)
    #define StrDup(str)         StrInitFromStr(str)
    
        ///
Last updated on