title: Reading unlimited length input line without using string
body: <p>I would like to read unlimited length line of text from the input. I wish not to use string or any of it.</p>
  
  <p>I tried that but it seems does not work. I always get the same output.</p>
  
  <p><strong>I do not want to use: <code>string</code>, the input has to be of any length.</strong></p>
  
  <pre><code>  #include &lt;iostream&gt;
  #include &lt;stdio.h&gt;
  using namespace std;
  
  char * getline(){
      char * buf = new char[10];
      int result = scanf("%as\n", &amp;buf);
      if (result &lt; 0) {
          if (NULL != buf)
              delete []buf;
          return NULL;
      }
      return buf;
  }
  
  int main(){
      char* haha =  getline();
      cout &lt;&lt;haha &lt;&lt; endl;
      return 0;
  }
  </code></pre>