title: iterate through array elements using its own pointer
body: <pre><code>int* arr = new int[30](); //30 is random serving the example's purposes
  
  while(&lt;insert check here that uses the arr pointer&gt;){
  
     cout&lt;&lt;*arr&lt;&lt;endl;
  
     arr++;
  }
  </code></pre>
  
  <p>This is me experimenting on tricks using pointers and I have been working on this for some time today. I have used many different checks in the while clause without ever getting it right (mostly ending up with infinite loops or seg faults). <strong>So my question can this be done or the standard for-loop method is the only way?</strong></p>