Convert string into integers for addition of fractions on C++ : <p>I have a problem with converting this input: 1/2 + 3/4 for example. This input is given as string. How can I convert it into integers and do the addition with this fractions. Here is my code:</p>

<pre><code>int main()
{
    char input[30];
    cin.getline(input, 30);
    char *tok;

    tok = strtok(input, "+ /");

    while (tok != NULL)
    {
        cout &lt;&lt; tok &lt;&lt; endl;
        tok = strtok(NULL, "+ /");
    }
return 0;
}
</code></pre>

<p>I splitted the string and extracted the numbers but they are still a chars, so how can i convert them into ints in that while loop?</p>
