[Dev-C++] Array of function pointers
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Abhijit S. <mu...@gm...> - 2002-06-30 18:28:12
|
Sorry for my repeated OT posts, but I don't subscribe to many lists because
they have too much of traffic, and poor little me has a dial-up account. Of
all the lists I do subscribe to, Dev-C++ seems to have the most
knowledgeable (and tolerant) people.
Having finished buttering you up, here's my question:
How do I create an array of function pointers?
I declare a function pointer as:
void (*fnPtr)(int arg1) = fn;
I tried making an array like this:
void *(*fnPtrs)(int)
Didn't work.
void (*fnPtrs)(int)[] = { fn, foo, NULL };
Didn't work either.
Ultimately, I got frustrated and made an array of dwords:
dword fnPtrs[] = { (dword)fn, (dword)foo, (dword)NULL };
This worked, without any warnings. Is this portable and safe? Is there any
other ANSI way of making an array of function pointers?
Thanks for any help.
--------------------------
http://mudeth.tripod.com
|