title: string input and output in C
body: <p>I have this snippet of the code:</p>
  
  <pre><code>char* receiveInput(){
      char *s;
      scanf("%s",s);
  
      return s;
  }
  
  int main()
  {
      char *str = receiveInput();
      int length = strlen(str);
  
      printf("Your string is %s, length is %d\n", str, length);
  
      return 0;
  }
  </code></pre>
  
  <p>I receive this output:</p>
  
  <pre><code>Your string is hellàÿ", length is 11
  </code></pre>
  
  <p>my input was:</p>
  
  <pre><code>helloworld!
  </code></pre>
  
  <p>can somebody explain why, and why this style of the coding is bad, thanks in advance</p>