online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
#include <iostream> #include <vector> using namespace std; int maxFreqofChars(string s, char *ch) { int N = s.length(); int maxCount = 0; vector<int> charCount(26); for (int i = 0; i < N; i++) { //cout << s[i] - 'A' << " stores " << s[i] << endl; charCount[s[i] -'A']++; if (maxCount < charCount[s[i] - 'A']) { maxCount = charCount[s[i] - 'A']; *ch = s[i]; } } return maxCount; } int main() { //string s = "AABABBA"; string s = "ABCDEFGHIJKLMNOPQRSTUVWXYZK"; char ch = ' '; int freq = maxFreqofChars(s, &ch); cout << "The maximum frequency of the char [" << ch << "] in an array " << s << " is " << freq << endl; 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