title: c strings, char pointers: need help printing the string and some advice
body: <p>so far i have this code:</p>
  
  <pre><code>char *str;
  scanf ("%s", &amp;str);
  printf("%s",&amp;str);
  system("pause");
  </code></pre>
  
  <p>it works, but the problem is after i press a key to continue the program (or end it), i get the following error:</p>
  
  <p>Run-Time Check Failure #2 - Stack around the variable 'str' was corrupted.</p>
  
  <p>i have never played around with char pointers before and i would like to get an explanation to why i am getting this error and how to improve the format of which i receive a string input from the user. i know there are easier ways to this, but my ultimate goal is to get the simplest code to determine the size of the input, and not limit the user.</p>
  
  <p>thanks in advance</p>