online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
#include <iostream> #include <string.h> #define maxsize 100 std::string toggle(std::string str) { if ( str.size() > maxsize) { std::cout << "Size of string is too big!" << std::endl; } else { for (int i = 0 ; i < str.size() ; i++) //note here i have removed <= and instead used < { if (isupper(str.at(i))) { str.at(i) = tolower(str.at(i)); std::cout << "UPPER CASE CONVERTED TO LOWER CASE "<< str.at(i) <<" " << std::endl; } else { str.at(i) = toupper(str.at(i)); std::cout << "LOWER CASE CONVERTED TO UPPER CASE "<< str.at(i) <<" " << std::endl; } } } return str; //added this return } int main() { toggle("Hello This Is A Test"); }

Compiling Program...

Command line arguments:
Standard Input: Interactive Console Text
×

                

                

Program is not being debugged. Click "Debug" button to start program in debug mode.

#FunctionFile:Line
VariableValue
RegisterValue
ExpressionValue