C++ Go back a line

Viewed 16069

I'm writing a multiple lines system, like this:

string readLines(string x)
{
    string temp = "a";
    vector<string> lines(0);
    string result;

    while (1)
    {
        cout << x;
        getline(cin, temp)

        if(temp != "")
        {
            result = result + "\n" + temp;
            lines.push_back(temp);
        }
        else
            break;
    }
    return result;
}

Is working fine, but I want be able to edit the previous line, for example, I'm typing something like this:

Helo,
World

I want to back on helo and fix my typo. How can I do this?

1 Answers
Related