DEV Community

Mohammad Tarikol Islam
Mohammad Tarikol Islam

Posted on

Problem in C Pointer

I Have a problem in my C code.
I can't explain the topic name as I am not sure exactly but expecting it may be in pointer.
the portion of code has been given below:

typedef struct Node{
}Node;
typedef enum{
}
int main(){
Node *add = (*makeFunc(ADD))(10, 6);
Node *mul = (*makeFunc(MUL))(5, 4);
calc(add);// result is: 16
calc(mul);//result is 20
}

Now the question is should I create a function named makeFunc(int a, int b) ? if i create the I know I can sent (10 ,6) as parameter but why (ADD) or (MUL) is processing here?

Help me by at least how to solve or topic name,else give me the solution please.
Thanks!!!

Top comments (0)