#include <stdio.h>int P1(int *a){return *a+1;}int P2(int *b){return 1+(*b+=1);}int P3(int *c){return *c++;}void main() { int (*p[])(int *)={P1,P2,P3,P1,P2,P3}; int i=0, t; while(1) {if((t=(*p[i]) (&i))==i) break; printf("%d",i=t); }}return 0 }
Standard input is empty
prog.c:5:6: warning: return type of 'main' is not 'int' [-Wmain] void main() { ^ prog.c:14:1: error: expected identifier or '(' before 'return' return 0 ^
Standard output is empty
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!