title: C++ How can I iterate till the end of a dynamic array?
body: <p>suppose I declare a dynamic array like</p>
  
  <pre><code>int *dynArray = new int [1];
  </code></pre>
  
  <p>which is initialized with an unknown amount of int values at some point.</p>
  
  <p>How would I iterate till the end of my array of unknown size?</p>
  
  <p>Also, if it read a blank space would its corresponding position in the array end up junked?</p>
  
  <h1>Copying Input From users post below:</h1>
  
  <p>Thing is:</p>
  
  <p>a) I'm not allowed to use STL (means: no )</p>
  
  <p>b) I want to decompose a string into its characters and store them. So far I wanted to use a function like this:</p>
  
  <pre><code> string breakLine (string line){
  
  
           int lineSize = line.size();
  
           const char *aux;
  
           aux=line.data();
  
           int index=0;
  
  
           while (index&lt;=lineSize){
           mySynonyms[index]=aux[index]; 
  
           index++;
           }
  </code></pre>
  
  <p>I thought that the array aux would end up junked if there was a large blank space between the two numbers to be stored (apparently not). And I was wondering if there was a way to iterate till an undefined end in this type of array. Thanks for you answers.</p>