title: How to determine the end of an integer array when manipulating with integer pointer?
body: <p>Here is the code:</p>
  
  <pre><code>int myInt[] ={ 1, 2, 3, 4, 5 };
  int *myIntPtr = &amp;myInt[0];
  while( *myIntPtr != NULL )
  {
      cout&lt;&lt;*myIntPtr&lt;&lt;endl;
      myIntPtr++;
  }
  
  Output: 12345....&lt;junks&gt;..........
  </code></pre>
  
  <p>For Character array: (Since we have a NULL character at the end, no problem while iterating)</p>
  
  <pre><code>char myChar[] ={ 'A', 'B', 'C', 'D', 'E', '\0' };
  char *myCharPtr = &amp;myChar[0];
  while( *myCharPtr != NULL )
  {
      cout&lt;&lt;*myCharPtr&lt;&lt;endl;
      myCharPtr++;
  }
  
  Output: ABCDE
  </code></pre>
  
  <p>My question is since we say to add NULL character as end of the strings, we rule out such issues!
  If in case, it is rule to add 0 to the end of integer array, we could have avoided this problem. What say?</p>