String examples

With pointers those examples would look a litte different: the array declarations would be replaced with "char *". The rest is the same.

   char name0[6];
   name0[0] = 'J';
   name0[0] = 'a';
   name0[0] = 's';
   name0[0] = 'o';
   name0[0] = 'n';
   name0[0] = '\0';  // don't forget to terminate the string

   // shows nicely that C strings are actually arrays:
   char name1[] = { 'J', 'a', 's', 'o', 'n', '\0' }; 
   char name2[6] = "Jason";  // you can specify the array length or
   char name3[] = "Jason";  // leave it to the compiler 
   // leave it to the compiler to avoid memory leaks. 
   char name4[100] = "This is not 100 characters long: waste of memory";  
   // BTW: whenever you use string literals like these examples 
   // the strings will end up in non-writeable text segment