title: Char pointers vs Int pointers passed to functions
body: <p>I thought I understood pointers, but I think there's a nuance by how they're treated differently that I'm not quite following. When I pass an integer pointer or the address of an integer to showInt, it will print out the same memory address as it would outside the function. However. When I pass the following pointer to showChar;</p>
  
  <pre><code>char* value = "One";
  showChar(value);
  </code></pre>
  
  <p>The address of the first element is different inside the function than it is outside the function. I understand that this is behaviour consistent with passing by value, and that a copy of the pointer is made within the function, however I was under the impression that a copy of a pointer still held the same address. Why is it different when dealing with pointers to char? If the char pointer just stores the address of the first element of the string literal, then why would the pointer in the function not point to the same memory location, but instead point to a new area in memory? That suggests to me that it isn't copying a char pointer, but creating a new char pointer and assigning it the value pointed to by the original pointer. If so, I don't understand why.</p>
  
  <p>I understand that you can access the pointer address in the function by passing a pointer-to-pointer, or a reference-to-pointer instead, but why this is the case still confuses me.</p>
  
  <p><strong>Passing a pointer to char;</strong></p>
  
  <pre><code>void showChar(char* name){
  
   cout &lt;&lt; name &lt;&lt; endl;
   cout &lt;&lt; &amp;name &lt;&lt; endl;
  }
  </code></pre>
  
  <p><strong>Passing a pointer to int;</strong></p>
  
  <pre><code>void showInt(int* num){
  
   cout &lt;&lt; num &lt;&lt; endl;
   cout &lt;&lt; *num &lt;&lt; endl;
  }
  </code></pre>