online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
#include <iostream> #include <map> int main() { std::string inputString; std::cout<<"Enter a string: "; std::cin>> inputString; //this map maps the char to their respective count std::map<char, int> charCount; for(char &c: inputString) { charCount[c]++; } std::size_t i = 0; //just go through the inputString instead of map for(char &c: inputString) { std::size_t index = inputString.find(c); if(index != inputString.npos && (index == i)){ std::cout << c <<"-" << charCount.at(c)<<std::endl; } ++i; } return 0; }

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