Hello,
I hope you are having a good day and thank you for your time.
Is it possible to make an array of commands such that if I want to go to a function with a certain input, I can use the input as an offset which will access a certain command and then return?
(some of this is pseudo code, so I left out the ;'s)
Code:
array1[7] = {command1,command2,command3,...,command7}
int main(void)
{
//do some stuff
get input from keyboard
n = keyboard input //pseudo code
array1[n] //Can I do this?
}
Can I just write an array of commands like this?:
Code:
cmdarray1[10] = {PlaySnd(6), SysBeep(200), SendString("Hello"),....., DelaySecs(4)}
and access it like this?:
i = keyboard input //pseudo code
cmdarray1[i];
Thanks.