title: How to copy contents of the const char* type variable?
body: <p>I know the difference between:</p>
  
  <pre><code>char *a = "string";
  char p[] = "string";
  </code></pre>
  
  <p>from <code>*a</code>, it acts as the following...</p>
  
  <pre><code>     +-----+     +---+---+---+---+---+---+---+ 
    a: |  *======&gt; | s | t | r | i | n | g |\0 |    
       +-----+     +---+---+---+---+---+---+---+ 
  </code></pre>
  
  <p>If I want to create another variable say</p>
  
  <pre><code>char *b;
  </code></pre>
  
  <p>and I hope it copies all contents in pointer a points to instead of pointing to the a's content.</p>
  
  <pre><code>     +-----+     +---+---+---+---+---+---+---+      
    a: |  *======&gt; | s | t | r | i | n | g |\0 |    
       +-----+     +---+---+---+---+---+---+---+ 
    b: |  *======&gt; | s | t | r | i | n | g |\0 |    
       +-----+     +---+---+---+---+---+---+---+ 
  </code></pre>
  
  <p>How to do this ?</p>