Ok, in a program i am making, i have options, with "Name" and "Function"

The "name" is obvious, it is what is shown so the user can choose.

However, i the function is what i want the computer to do with certain variables.

I.e. say i had an option called "Add" and two variables num[0] and num[1]
the option's function is: "num[1] += num[0]; cout<<num[1]<<endl;"

How can i get the program to 'run' this string when the user selects the option, so that the variable is changed?

I.e. Do(option.function) or something like that