title: Char Pointers and malloc
body: <p>I was a bit confused with the concept of char pointers so I made a simple code just printing my name provided by user (me). I also wanted to practice malloc so I referenced the pointer to a certain memory in RAM, but I really didn't know what to put after "sizeof(char) *" because that is the user input, which is not yet decided. 
  Also, after doing that, I freed the memory, but I got an error message on command line saying:</p>
  
  <pre><code>*** Error in `./char': double free or corruption (fasttop): 0x00000000017fe030 ***
  Aborted
  </code></pre>
  
  <p>It seems like I freed the same memory twice or something, but I don't know what to delete or add. Please help!</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;cs50.h&gt;
  
  int main (void)
  {
  
      char *strings = malloc(sizeof(char) * 10);
  
  
      printf("What is your name?\n");
  
      //wait for use to type his/her name
      strings = get_string();
  
  
      printf("Hello %s\n", strings);
  
      free (strings);
  
      return 0;
  }
  </code></pre>