typedef is used to create an alias name for other data type and you cannot initialize a type.
So, this is wrong:
typedef void (*ptr[4])( int a, int b)={fn1,fn2,fn3,fn4};
^^^^^^^^^^^^^^^^^
Instead you should do:
typedef void (*ptr[4])( int a, int b);
This will creates ptr as a type for array of 4 function pointers that takes two int type as argument and does not return any value.
Now using this alias name ptr you can create variable of its type, like this:
ptr x = {fn1, fn2, fn3, fn4};
This will initialize variable x which is an array of 4 function pointers of type ptr.
You can call it like this:
x[0](1, 2); // this is equivalent to fn1(1, 2)
x[1](1, 2); // this is equivalent to fn2(1, 2)
....
.... and so on.
But the statement
ptr x = ...
Just by looking at it, it doesn't seems that x is an array until you look into the ptr typedef.
So, for better readability you can do:
typedef void (*ptr)( int a, int b);
This will creates ptr as a type for function pointer that takes two int type as argument and does not return any value.
Now to create the array of 4 function pointers of type ptr, you can do:
ptr x[4] = {fn1, fn2, fn3, fn4};
Call it in similar way:
x[2](1, 2); // this is equivalent to fn3(1, 2)