#include <iostream>using namespace std; int m1[]={0,2,4,6};int m2[]={1,3,5,7}; int (*fun)int n))[end (m1)-begin (m1)]{return (n%2!=0 ) ? &m1 : m2;} int main (){int c;cin>>c;//int (*p)[sizeof (m1)/sizeof (m1[0])]=fun (c); int (*p)[end (m1)-begin (m1)]=fun (c);cout <<*p;}
Standard input is empty
prog.cpp:7:11: error: expected initializer before ‘int’ int (*fun)int n))[end (m1)-begin (m1)]{ ^~~ prog.cpp: In function ‘int main()’: prog.cpp:14:38: error: ‘fun’ was not declared in this scope int (*p)[end (m1)-begin (m1)]=fun (c); ^
Standard output is empty
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!