Skip to content

Instantly share code, notes, and snippets.

View cmalagacode's full-sized avatar

Cristian Malaga cmalagacode

View GitHub Profile
void reverseString(std::string& s)
{
size_t left = 0, right = s.size() - 1;
while (left < right)
{
char temp = s[left];
s[left] = s[right];
s[right] = temp;