I'm making a program where the user can input a string and the result is shows.
For example: If the user inputs cos(0) then the output is 1
There are more functions then cos, in fact, there are a thousand more functions. Is there a way, instead of checking which function the user entered, that I can somehow bind the input to a real c++ function?
If all your functions are in form "name(argument)" it's simple. First parse the input to split it to the function name "cos" and the argument "0". Then convert the argument to a float.
Have an std::map<std::string, float(*function)(float)> with all the functions you need.