Help with conversion string to double?
<p>I don't know what's going on here. I am converting two strings to doubles and the first one always goes through, but the second doesn't and it doesn't matter which way I switch them!
Here's the code:</p>

<pre><code>
    #include &#60iostream>
    #include &#60math.h>
    #include &#60string>
    #include &#60sstream>
    using namespace std;

    int main() {
        string temp;
        double ax,bx,cx,ay,by,cy;
        cout &#60&#60 "Enter x and y for point 1 (separated by a comma)";
        cin >> temp;
        int where=temp.find(",");
        int hmm=temp.length()-where;
        cout &#60&#60 hmm &#60&#60 endl &#60&#60 where &#60&#60 endl;
        cin.get();
        stringstream ss;
        string stAx,stAy;
        stAx= (temp.substr(0,where));stAy =  (temp.substr(where+1, hmm-1));
        ss &#60&#60 stAx;ss >> ax;
        ss &#60&#60 stAy;ss >> ay;
        cout &#60&#60 "Ax: " &#60&#60 ax &#60&#60 endl;
        cout &#60&#60 "Ay: " &#60&#60 ay &#60&#60 endl;

        system("pause");
        return 0;   
    }


</code> </pre>

<p>Can anybody figure out what I'm doing wrong? </p>

<p>Thanks in advance! </p>
