Skip to content

Latest commit

 

History

History
19 lines (16 loc) · 400 Bytes

reverse-string.md

File metadata and controls

19 lines (16 loc) · 400 Bytes
title description author tags
Reverse String
Reverses the characters in a string.
Vaibhav-kesarwani
array,reverse,c++23
#include <string>
#include <algorithm>

std::string reverseString(const std::string& input) {
    std::string reversed = input;
    std::reverse(reversed.begin(), reversed.end());
    return reversed;
}

reverseString("quicksnip"); // Returns: "pinskciuq"