title: Change value in character pointers results in blank or question mark
body: <p>I am trying to learn about C programming. At the moment I am trying to understand variables of different character types. Eg: char var VS char* var VS const char var VS const* char var, etc. This is the code I came up with:</p>
  
  <pre><code>char* char_A[2] = {'A'};
  const char* char_AA[2] = {'AA'};
  char* const char_AAA[50] = {'AAA'};
  const char* const char_AAAA[50] = {'AAAA'};
  
  printf("\n\n"
         "char_A: %c\n"
         "char_AA: %c\n"
         "char_AAA: %c\n"
         "char_AAAA: %c\n"
         " \n\n"
         , char_A, char_AA, char_AAA, char_AAAA);
  
  char_A[0] = 'B';
  char_AA[0] = 'CD';
  // char_AAA = 'Changed char_AAA'; // ILLEGAL, reason: constant content, movable pointer
  // char_AAAA = 'Changed char_AAAA'; // ILLEGAL, reason: constant content and pointer!
  
  printf("\n\n"
         "char_A: %c\n"
         "char_AA: %c\n"
         "char_AAA: %c\n"
         "char_AAAA: %c\n"
         " \n\n"
          , char_A, char_AA, char_AAA, char_AAAA);
  
  //*char_AAA = char_A; // allowed because only the content cannot be changed (does not work with char array but works with other format, I believe)
  // *char_AAAA = &amp;char_AA; // ILLEGAL, reason: constant content and pointer!
  
  
  printf("\n\n"
         "char_A: %c\n"
         "char_AA: %c\n"
         "char_AAA: %c\n"
         "char_AAAA: %c\n"
         " \n\n"
          , char_A, char_AA, char_AAA, char_AAAA);
  </code></pre>
  
  <p>why do I get the following output?:</p>
  
  <pre><code>char_A: 
  char_AA: �
  char_AAA: P
  char_AAAA: �
  
  
  
  
  char_A: 
  char_AA: �
  char_AAA: P
  char_AAAA: �
  
  
  
  
  char_A: 
  char_AA: �
  char_AAA: P
  char_AAAA: �
  </code></pre>
  
  <p>I previously defined my char variables in the following way: <code>char* char_A = 'A';</code> but too did not result in my expected output. I was unable to change the values of the char variables so I tried char arrays instead, which as you can see did not go as I planned...</p>
  
  <p>tl;dr why do I get this weird output, why will my char variables not change as I want them to?</p>
  
  <p>Edit: I am using CLion to compile my program, it uses CMake to compile. There are no errors and it runs well. HOWEVER, when I compile the program with gcc I get errors, as the comments are pointing out. Anyone care to illustrate how all of these types differ? I can only find tutorials and answers comparing two and maybe three of them, but not all of them. I have put this little infographic together that I got from multiple websites:</p>
  
  <p>char* vs const char* vs char* const vs const char* const</p>
  
  <ul>
  <li><p>char* means that both the pointer and the contents (character/string) can be changed</p></li>
  <li><p>const char* means that the pointer can be changed but the content cannot</p></li>
  <li><p>char* const means that the pointer cannot be changed but the content can</p></li>
  <li><p>const char* const means that both the pointer AND the content CANNOT be changed</p></li>
  </ul>