online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
#include <cstdio> struct B{ int n,a=1,b=1; B(int n):n(n){ printf("+(%d)[%08p]\n",n,this); } B(B& n){ *this=n; printf("B(B) [%08p] [%08p]\n",this,&n); } ~B(){ printf("-[%08p]\n",this); } void next(){ n-=1; int r=a+b; b=a; a=r; } B& begin(){ return *this; } int operator*() { return b; } B& operator++(){ next(); return *this; } bool operator!=(int b) { return n>b; } int end(){ return 0; } }; int main() { for (auto x:B(10)) printf("%-3d",x); printf("\n===\n"); auto r=B(10); printf("=\n"); auto a=r.begin(); //Зачем тут ещё один конструктор B(B) вызывается? printf("=\n"); auto b=r.end(); for (;a!=b;++a) printf("%-3d",*a); }

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