I have written a piece of code to solve a differential equation using Euler's method. The code allows the user to input where they would like the solution to approximate at, but I'd like the user to be able to input either a numerical value or something like pi/2 as the function is trigonometric. Is it possible to use cin in this way? Thanks a lot.
No, there is no built-in way to allow expression like that. You'll have to write the parser yourself or look for an existing library that does the job.