title: Malloc and scanf
body: <p>I'm fairly competent in a few scripting languages, but I'm finally forcing myself to learn raw C.  I'm just playing around with some basic stuff (I/O right now).  How can I allocate heap memory, store a string in the allocated memory, and then spit it back out out?  This is what I have right now, how can I make it work correctly?</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  
  int main(int argc, char *argv[])
  {
    char *toParseStr = (char*)malloc(10);
    scanf("Enter a string",&amp;toParseStr);
    printf("%s",toParseStr);
    return 0;
  }
  </code></pre>
  
  <p>Currently I'm getting weird output like '8'\'.</p>