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) {
    printf("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

Share :