Array of functions? Avoiding if's for calling routines
Posted: Fri Dec 03, 2010 2:11 pm
Hello, I'm coding a program that receives a value CMD from the UART (along with other things). I want to call functions depending on the value of CMD. Right now I'm using this:
which I find very ineffective and hard to code for 256 functions.
Is there any way I could do some kind of array or lookup table where I assign CMD as the pointer and call the instruction?
Thanks _________________ 0x2BE NOR 0X2BE
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
Posted: Fri Dec 03, 2010 2:38 pm
Quote:
Is there any way I could do some kind of array or lookup table ?
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum