Amiga.org
Operating System Specific Discussions => Amiga OS => Amiga OS -- Development => Topic started by: Einstein on May 17, 2005, 05:11:56 PM
-
I've recently resumed (!) some C programming (in windows though), now the problem I've ran into is this: I'm trying to access a function through a pointer to it by declaring the pointer as void and then try to call the function with:
*funcPtr();
and:
*(funcPtr)();
and even:
(*(funcPtr))();
Yes, I realize I'm drunk ( :-D ), so tell me, how do I do ?
-
Dammit people, why dont you respond ? :-(
-
It's (* funcPtr)();
...
-
BTW, that probably won't work either I don't think C allows using a void * as a function pointer. Try to do some casting first.
-
Thanx for your responce, however, what's casting ?
-
Jose wrote:
BTW, that probably won't work either I don't think C allows using a void * as a function pointer.
That's pretty stupid is'nt it ? WHY wouldnt the compliler
allow such accessing one figures !!
-
I'm still interested of help if you people wonder. :-D
-
(http://images.amazon.com/images/P/0764508350.01.LZZZZZZZ.jpg)
-
http://www.newty.de/fpt/fpt.html#defi
google and you shall find
casting is casting a type to a pointer. like, you can declare the function parameter as a void pointer, then you can cast it to a specific type and use it.
int myWindozeFunction (void * groovy, int what)
if (what == 1)
int * myIntPtr = (int *) groovy;
something like this...
-
LinchpiN wrote:
(http://images.amazon.com/images/P/0764508350.01.LZZZZZZZ.jpg)
I asked for a simple declaration for a function-pointer, not your inner and outer state in front of a mirror dude. :-)
-
countzero wrote:
http://www.newty.de/fpt/fpt.html#defi
google and you shall find
casting is casting a type to a pointer. like, you can declare the function parameter as a void pointer, then you can cast it to a specific type and use it.
int myWindozeFunction (void * groovy, int what)
if (what == 1)
int * myIntPtr = (int *) groovy;
something like this...
Thank you, appreciate the help. (http://www.amiga.org/images/subject/icon14.gif)