online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code    Language
#include <algorithm> int CountNumberOfSetBits(int number){ int temp=number; int count=0; for (int k=0;temp!=0;k++){ temp=(number>>k); if ((temp%2)==1){ count++; } } return count; } bool mycompare(int a,int b){ int count1=CountNumberOfSetBits(a); int count2=CountNumberOfSetBits(b); if (count1<=count2){ return false; } return true; } void sortSetBitsCount(vector<int>& arr, int size) { stable_sort(arr.begin(),arr.end(),mycompare); }

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