title: How to read the standard input into string variable until EOF in C?
body: <p>I am getting "Bus Error" trying to read <code>stdin</code> into a <code>char*</code> variable.
  I just want to read whole stuff coming over <code>stdin</code> and put it first into a variable, then continue working on the variable.</p>
  
  <p>My Code is as follows:</p>
  
  <pre><code>char* content;
  char* c;
  while( scanf( "%c", c)) {
   strcat( content, c);
  }
  
  fprintf( stdout, "Size: %d", strlen( content));
  </code></pre>
  
  <p>But somehow I always get "Bus error" returned by calling <code>cat test.txt | myapp</code>, where <code>myapp</code> is the compiled code above.</p>
  
  <p>My question is how do i read <code>stdin</code> until EOF into a variable? As you see in the code, I just want to print the size of input coming over stdin, in this case it should be equal to the size of the file <code>test.txt</code>.</p>
  
  <p>I thought just using <code>scanf</code> would be enough, maybe buffered way to read <code>stdin</code>?</p>