I am trying to experiment with C++ to make the command prompt function like MatLab or Octave.
This is a practice file I've been doing so I could pass functions as parameters to other functions.
My problem is with my function call compute(gset[function-1], input);
This is supposed to be correct according to what I know and according to another program that uses this similar snippet with the difference being the implementation of the function that I am passing a function to is in a separate header file.
So far I only have one compilation error and if somebody can help me with this, I'd truly be grateful.
"function" is a double. Array index has to be int. How would you expect gset[0.5] to work?
The rest is good. See http://ideone.com/cpwmZ
By the way, that goto should be replaced by a loop. It's just a while(true) loop in this case.
Thank you hamsterman! That was really careless of me to use type double for index. I'll take your advice of using a while loop instead as well. I'm very grateful for your help.