*Not asking for code just point me in the right direction*
So I've written a program to handle strings that look like mathematics. Ex: it knows that sin(cos(x)) is first cos(x)=y then sin(y)=answer.
What I need now is advice on how to read a string and pull integers out of it. If I have "x + 2", I can make it realize it needs to add but not sure how to make it realize that the 2 is a double 2.
Again, I don't need a code answer. I am new to programming so I just need to know where to look.
I think your problem is a bit more general than that. You should look up information on (specifically, calculator) parsers. I'm sure there is a description of an algorithm for an infix calculator or something similar.
What i'm doing requires me to pass strings though. The program is (eventually) going to be able to derive functions, then compute with them. It allows me to use a bit more advanced mathematics in simulations.
I would read it in as a string too. I don't really see how that makes looking for an algorithm any less relevant.
In the simple case of something like "3 + 2", you read the first part of the string (up to a space), call that your lhs. Read the next part for your operator, and the last for your rhs. Then perform the operation based on your operator. Naturally, it is a bit more complex with things like trigonometric functions, parentheses, variables, etc. but I hope you see what I'm trying to mean.
I'm not sure I get what you are asking but if you want to convert a string represention of a number into a double then this works:
1 2 3 4 5 6 7 8 9 10
#include <sstream>
#include <string>
std::string str = "23.56";
double dd;
// convert the string into an input stream and
// read a double from it
std::istringstream(str) >> dd; // dd now has value 23.56