Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!cbosgd!ihnp4!ltuxa!we53!sw013b!dj3b1!killer!toma From: toma@killer.UUCP (Tom Armistead) Newsgroups: net.lang.c Subject: pointers to functions Message-ID: <237@killer.UUCP> Date: Fri, 20-Jun-86 16:41:10 EDT Article-I.D.: killer.237 Posted: Fri Jun 20 16:41:10 1986 Date-Received: Sat, 21-Jun-86 13:06:22 EDT Organization: The Unix(tm) Connection BBS, Dallas, Tx Lines: 35 Keywords: can you cast them? The delima - Is it possible to cast a 'pointer to' a function? What I have is a char * that holds the address of a function. int foo(); char *addr = foo; Would it be possible to call the function foo() via the variable addr? Secondly is it possible to have an array of type 'pointer to' function. i.e. int (*function)()[SIZE]; something like the above, I was able to achieve this using this: struct fct { int (*func)(); } f_array[SIZE]; function() { int x; printf("offset: "); scanf("%d",&x); (*f_array[x].func)(); } Is there another way??? Something to think about... Thanx in advance for **ANY** help, - Tom --- UUCP: ihnp4!cuae2!tuxa!we53!sw013b! \ \dj3b1!killer!toma / drillsys!infoswx!convex!/ Tom Armistead