StrReverse

Table of Contents

StrReverse

Description

Reverse contents of this string.

Parameters

NameDirectionDescription
strin,outStr to be reversed.

Success

str

Failure

NULL

Usage example (Cross-references)

    // 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
    // Advanced operations
    case STR_REVERSE : {
    StrReverse(str);
    break;
    }

Share :