I am making a program in C++ that performs some basic calculus functions. In order to create an equation to perform these functions with I am using the following code:
float equationone(float x) { return sqrt(x); } float equationtwo(float x) { return (x * x); } I am wondering how can I adapt my code so the user can enter something like sqrt(x) or (x*x) and have the functions return the proper answer.
std::regexin<regex>header. provided you have c++11 compatibility