title: C++ Go back a line
body: <p>I'm writing a multiple lines system, like this:</p>
  
  <pre><code>string readLines(string x)
  {
      string temp = "a";
      vector&lt;string&gt; lines(0);
      string result;
  
      while (1)
      {
          cout &lt;&lt; x;
          getline(cin, temp)
  
          if(temp != "")
          {
              result = result + "\n" + temp;
              lines.push_back(temp);
          }
          else
              break;
      }
      return result;
  }
  </code></pre>
  
  <p>Is working fine, but I want be able to edit the previous line, for example, I'm typing something like this:</p>
  
  <pre><code>Helo,
  World
  </code></pre>
  
  <p>I want to back on <code>helo</code> and fix my typo. How can I do this?</p>