title: c pointer with string
body: <p>Trying to learn pointers better I wrote this code. The intention was to print one character of a string at a time in a for loop. Again trying to learn how to increment a pointer and then dereference the pointer.</p>
  
  <pre><code>char *string = "abcdef";
  char *pointer = &amp;string; 
  
  for (int i =0; i &lt; 4; i++)
  
  {   
      printf("the next charater is %c\n", *pointer);
      pointer = (char *)pointer + sizeof(char);
  }
  </code></pre>
  
  <p>want it to print:</p>
  
  <p>the next charater is a</p>
  
  <p>the next charater is b</p>
  
  <p>the next charater is c</p>
  
  <p>the next charater is d</p>