|
From: | Lars Noschinski |
Subject: | Re: [avr-gcc-list] calling function pointers via pointers ? |
Date: | Wed, 28 Sep 2005 14:29:02 +0200 |
User-agent: | mutt-ng devel (Linux) |
* Vincent Trouilliez <address@hidden> [2005-09-28 14:16]:
Another pointer problem again, oops... I need pointers to functions in my project. Using the great on-line resource http://www.eskimo.com/~scs/C-faq/q4.12.html which someone on here mentioned recently, I got the basics working. But my actual case at hand is a bit trickier and I am lost again (okay, doesn't take much to loose myself I admit ;-). Problem: my function pointers are in an array, within a structure, which itself is accessed via pointers... oh dear.
Just do it step by step, at least for first tries use temporary variables - you can avoid those after you understood what to do ;) - Dereference the pointer to the struct. This gives you a struct. - Select the field from the struct. This gives you an array. - Select the entry from the array. This gives you a function pointer. - Dereference the function pointer and call the function. Done.
[Prev in Thread] | Current Thread | [Next in Thread] |