A question about pointers to functions.
Mark H. Colburn
mark at ems.UUCP
Sun Jan 18 07:23:09 AEST 1987
In article <1508 at cit-vax.Caltech.Edu> trent at cit-vax.UUCP (Ray Trent) writes:
>Question: How do you declare an array of pointers-to-void-functions, and
>is it possible to initialize such an array? (with the array initialization
>technique {arrel1, arrel2, ...})
Try the folowing:
void func1(), func2(), func3(), func4();
void (*fnarray[])() = {
func1, func2, func3, func4
};
This will give you an array of pointers to functions returning a void type
that has been initialzed with the pointers to func1, func2, func3 and func4.
I think that this is what you are looking for.
--
Mark H. Colburn UUCP: {rutgers|amdahl|ihnp4}!{dayton|meccts}!ems!mark
EMS/McGraw-Hill ATT: (612) 829-8200
9855 West 78th Street
Eden Prairie, MN 55344
More information about the Comp.lang.c
mailing list