The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
Newsgroups: comp.lang.c
From: throopw@dg_rtp.UUCP (Wayne Throop)
Date: Mon, 12-Jan-87 15:29:51 EST
Local: Mon, Jan 12 1987 3:29 pm
Subject: Re: function pointer help needed
> j...@loral.UUCP (Jim Vaxkiller) You have declared ptr_tbl to be an array of pointers to functions > I'm having a little problem with tables of pointers to functions. > What I want to do is have several functions returning type void, > The following code fragment illustrates my problem. > void err0() {} > int err1() {} > static (*ptr_tbl[])() = { err0, err1 }; > main() { (*ptr_tbl[0])(); } returning int, and err0 is a pointer to a void function. You must use casts or unions if you wish to have an array of pointers to functions of more than one type. Unions are probably the best method, though there are problems with initializers for unions. I don't see any portable way to statically initialize an array of pointers to functions of differing types. -- You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||