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 complex number micro parser for Spirit...\n\n";    cout << "/////////////////////////////////////////////////////////\n\n";    cout << "Give me a complex number of the form r or (r) or (r,i) \n";    cout << "Type [q or Q] to quit\n\n";    string str;    while (getline(cin, str))    {        if (str[0] == 'q' || str[0] == 'Q')            break;        complex<double> c;        if (parse_complex(str.c_str(), c))        {            cout << "-------------------------\n";            cout << "Parsing succeeded\n";            cout << str << " Parses OK: " << c << endl;            cout << "-------------------------\n";        }        else        {            cout << "-------------------------\n";            cout << "Parsing failed\n";            cout << "-------------------------\n";        }    }    cout << "Bye... :-) \n\n";    return 0;}