Skip to content

StrReverse

StrReverse

Description

Reverse contents of this string.

Parameters

Name Direction Description
str in,out Str to be reversed.

Success

str

Failure

NULL

Usage example (Cross-references)

Usage examples (Cross-references)
            // Advanced operations
            case STR_REVERSE : {
                StrReverse(str);
                break;
            }
    // Test StrReverse function
    bool test_str_reverse(void) {
        WriteFmt("Testing StrReverse\n");
    
        Str s = StrInitFromZstr("Hello");
    
        // Reverse the string
        StrReverse(&s);
    
        // Check that the string was reversed
    
        // Reverse the string
        StrReverse(&s);
    
        // Check that the string was reversed
    
        // Reverse the string
        StrReverse(&s);
    
        // Check that the string is unchanged
    
        // Reverse the string
        StrReverse(&s);
    
        // Check that the string is still empty
Last updated on