I have a question about reading segments of a string and extracting information.
For example, how would I differentiate the difference between a number and string such as "sin(45)" where sin is a mathematical function?
My thinking is to declare a string, two chars for the parenthesis, and a int/double for the number inside the parenthesis.
You are talking about tokenizing. Which isn't a particularly easy task, though it is straightforward.
Your tokenizer should be able to know where one type of thing stops and a new type of thing begins. This is the most important characteristic.
For the string "sin(45)", the very first character read is an 's', so your tokenizer should know that it cannot be a number. It isn't puncutation, so it must be a name (either a variable or a function, right?).
Next it should read all the characters that are valid for a name. In this case, a parenthesis is not a valid name character, so the name stops with "sin".
Now the tokenizer reads an opening parenthesis '('. This should properly indicate a subexpression; at some point there should be a matching ')'.
The next character is a digit '4', so the tokenizer recognizes that you are reading a number. Read all digits of the number "45". It knows when to stop because the parenthesis is not a number character.
If you want to study this in more detail, google around "recursive descent".