So, I need to make a script that can receive an equation stored in a string, and then solve said equation. I want to use popen() to call in the bc program to solve said equation, but I'm not sure exactly how to do that. All the resources I've seen take their input from a FILE or stdin, and none of them explain how to call bc, then give it a string input. I'm not very good at coding in C yet, so I have a very hard time coming up with a solution to this.
I don't know exactly what the equations will be, but they won't be more complex than integers and a few basic operations.