title: Print out every other character in an array only using pointers
body: <p>I'm having an issue with a programming excercise using pointers in C++.</p>
  
  <p>My goal is to only print every other character in my array while only using pointers.</p>
  
  <p>This for loop below works to print out all the characters from my array but I've been having issues only printing out every other character.</p>
  
  <p>I've tried incrementing i by doing <code>i+=2</code> but that only prints out very stange characters that have nothing to do with my array.</p>
  
  <p>This code isn't all of my code. It's just a snippet of it to understand how to do this.</p>
  
  <pre><code>char myChar[13] = {'J', 'o', 'h', 'n', ' ', 'H', 'a', 'n', 'c', 'o', 'c', 'k', '\0'};
  char myChar2[13] = {'J', 'o', 'h', 'n', ' ', 'H', 'a', 'n', 'c', 'o', 'c', 'k', '\0'};
  
  
  
  
  char *temp5 = myChar;
  char *temp6 = myChar2;
  
  
  
  // Prints out all characters from array using pointers
  cout&lt;&lt;"\n\nThis is the original element for the char array.\n\n";
  cout&lt;&lt;"\t";
  for(int i = 0; i&lt; 13; i++)
  {
      *temp6 = *temp5;
      temp5++;
  
      cout&lt;&lt;*temp6;
  }
  </code></pre>