0

im trying to declare an array of three pointers to functions and invoke the appropriate function based on an index value passed in as an argument im getting confused,this is the code i wrote

int brr,func,arr(int *a[3],float *b[5] ,char *c[6]) 
{
    brr();`func();`
    printf("%d\n",brr);
    return 0;    
}
Barmar
  • 741,623
  • 53
  • 500
  • 612
sandrah
  • 1
  • 1
  • 2
    Sorry, your question is not clear. What does "void as outerscope" mean? And how does it relate to the code you have shown? Can you please provide clearer and more description? – kaylum Aug 27 '20 at 22:10
  • 1
    This code makes absolutely no sense. And why do you have backticks around `func();`? – Barmar Aug 27 '20 at 22:11
  • 1
    You may want to rephrase the question and start with what you would like to achieve. – Tom Aug 27 '20 at 22:14
  • Your code either misunderstands the declaration of return values or tries to define variables and functions in a way which is to fancy for me (and possibly to compilers). Please make your code more straight forward and above all, compilable. – Yunnosch Aug 27 '20 at 22:32
  • I'm trying to declare an array of three pointers to functions, after the declaration.Then i execute the appropriate function based on an index value i passed to a function .Let me rewrite in this way if you can my point clearer void arr() { int brr[] = {5,8,2}; // float func[5]; //char arr[6]; printf("%d\n",*(brr + 1)); } int main() { arr(); return 0; } – sandrah Aug 28 '20 at 16:35
  • I've rewritten the code,but i think this is not my goal to achieve. I'm trying to declare an array of three pointers to functions and execute the appropriate function based on an index value passed to the function as an argument . – sandrah Aug 28 '20 at 16:35

0 Answers0