Path: chuka.playstation.co.uk!news From: James Russell Newsgroups: scee.yaroze.freetalk.english Subject: Re: Question for the C experts Date: Thu, 03 Sep 1998 18:11:19 +0100 Organization: Sony Computer Entertainment Europe Lines: 24 Message-ID: <35EECDB7.334B8EB5@scee.sony.co.uk> References: <35EEB905.940C6E98@ndirect.co.uk> NNTP-Posting-Host: mailgate.scee.sony.co.uk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 4.5b1 [en] (Win95; I) X-Accept-Language: en Alex Herbert wrote: > > Is there any way I can hold a table of pointers to the functions and > call them using an index? Always a tricky one. Assuming your functions are all "void functionName(void)" then: void (*funcIndex[])(void) = { function0, function1, function2 }; void (*func)(void); func = funcIndex[myIndex]; func(); Cheers, James -- == James_Russell@scee.sony.co.uk +44 (171) 447-1626 == Developer Support Engineer - Sony Computer Entertainment Europe A poor man's holodeck: A tab of acid and a glass of water.