reverseString

Run Settings
LanguageC++
Language Version
Run Command
#include <iostream> using namespace std; void reverseString(string s) { int high = s.length() - 1; int low = 0; // string reversedString; //cout << reversedString; while (low < high) { cout << "low : " << low << endl ; cout << "high : " << high << endl; char temp = s[low]; s[low] = s[high]; s[high] = temp; low ++; high --; } // for (int i= len-1; i>=0; i--) { // reversedString.push_back(s[i]); // } cout << s; } int main() { // cout << fibo(6) << endl; reverseString("abcde"); return 0; }
Editor Settings
Theme
Key bindings
Full width
Lines