online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
#include <iostream> #include <vector> using namespace std; int main() { vector<int> arr = { 2, 3, 1, -4, -4, 2 }; cout<< arr.size() << endl; // 6 cout<< (-1 % arr.size()) << endl; // 3, incorrect without parsing cout<< (-1 % 6) << endl; // -1 cout<< (-1 % (int)arr.size()) << endl; // -1 UPDATE, correct answer onlye when parsed }

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