rem: if (str[0] == 'q' || str[0] == 'Q')
add: if (str.empty() || str[0] == 'q' || str[0] == 'Q')
context: main(){    cout << "/////////////////////////////////////////////////////////\n\n";    cout << "\t\tA primitive calculator...\n\n";    cout << "/////////////////////////////////////////////////////////\n\n";    cout << "Give me a list of numbers to be added or subtracted.\n";    cout << "Example: 1 + 10 + 3 - 4 + 9\n";    cout << "The result is computed using Phoenix.\n";    cout << "Type [q or Q] to quit\n\n";    string str;    while (getline(cin, str))    {        if (str[0] == 'q' || str[0] == 'Q')            break;        double n;        if (primitive_calc(str.begin(), str.end(), n))        {            cout << "-------------------------\n";            cout << "Parsing succeeded\n";            cout << str << " Parses OK: " << endl;            cout << "result = " << n;            cout << "\n-------------------------\n";        }        else        {            cout << "-------------------------\n";            cout << "Parsing failed\n";            cout << "-------------------------\n";        }    }    cout << "Bye... :-) \n\n";    return 0;}