title: The difference between char * and char[]
body: <p>I've read so many threads and questions about it and read so many answers but STILL having difficulties understanding the differences and when you should use what ?</p>
  
  <p><strong>I think you should use char* when you need to store data and you don't know the size of it because it's dynamic.
  Also I'm not sure if i'm right but from what I've understand if you declare a char* and assign it a literal text like this :
  char *ch = "hi";
  it's a constant that you can't change and if you do try to change it you'll just point ch to another allocated memory space holding the new string ?
  If write it this way :
  char <em>ch = malloc(20);
  then you can change the value
  and if you do this :
  char ch[] = "hi";
  char</em> pch = ch;
  you can change the values aswell because you point to the array and the arrays points to ch[0] ?</strong></p>
  
  <p>All the is written in bold is my understanding from reading, although I'm probably wrong about most of the stuff I just said and that's why I need a REALLY GOOD and simple explanation so I could once and for all understand the differences and when I should use what.</p>
  
  <p>EDIT :</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  main()
  {
      char ch[] = "Hello";
      char *p1 = ch;
      char *p2 = p1;
      char *p3 = *p1;
      printf("ch : %s\n", ch);
      printf("p1 address [%d] value is %s\n", p1, *p1);
      printf("p2 address [%d] value is %s\n", p2, *p2);
      printf("p3 address [%d] value is %s\n", p3, *p3);
      return 0;
  }
  </code></pre>