Skip to content

StrReverse

Description

Reverse the characters of the string in place. See VecReverse for the full SUCCESS/FAILURE contract.

Usage example (Cross-references)

Usage examples (Cross-references)
    // Test StrReverse function
    bool test_str_reverse(void) {
        WriteFmt("Testing StrReverse\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        // 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