title: Implementing my own getline function
body: <p>Good day,
  I'm trying to write a get line function that will take user input and stored it into a character array. The code below is what I've come up with so far but unfortunately my code just sits at the command prompt. I'm not sure what's wrong, I've tried numerous approaches but I can't seem to get it to work. Any help would be appreciated, thank you in advance.</p>
  
  <p>In addition; here's the code for the overloaded function +=;</p>
  
  <pre><code>void MyString::operator +=(char addend)
  {
      reserve(getLength() + 2);
      char ch[1] = { addend };
      strncat(sequence, ch, 1);
  };
  </code></pre>
  
  <p>My getline function:</p>
  
  <pre><code>istream&amp; getline(istream&amp; ins, MyString&amp; target)
  {
  
      char ch = 0;
      istream&amp; get(char&amp; ch);
      while (ins &amp;&amp; ch != '\n')
      {
          istream&amp; get(char&amp; ch);
          target += ch;
      };
      return ins;
  };
  </code></pre>