title: Count the amount of values in the table c++
body: <p>I got a structure</p>
  
  <pre><code>struct number{
  int value;
  };
  
  number numbers[1000];
  </code></pre>
  
  <p>I have a for loop to input the values and breakoff when the user decides to leave adding panel, that feature works fine. I got another for loop for displaying the entered data which does the job (kind of) as it requires me to use system("pause"); otherwise the loop constantly enters everything within the function including the couts that are outside of the loop.</p>
  
  <pre><code>void ListNumbers(){
      system("cls");
      cout &lt;&lt; "\t\t\tArray: Numbers" &lt;&lt; endl;;
      cout &lt;&lt; "Value" &lt;&lt; endl;
      for (int i = 0; i &lt; 1000; i++){
          if (NULL == numbers[i].value)
              break;
          cout &lt;&lt; numbers[i].value &lt;&lt; endl;
  
  
      }
      cout &lt;&lt; "\n\nAmount of records: " &lt;&lt; sizeof(numbers) / sizeof(numbers[0]) &lt;&lt; endl;
      system("pause");
  </code></pre>
  
  <p>I want the program to list the amount of records/indexes in the table that are currently filled with data. Currently it displays the total amount of records in the database (being 1000). Also if possible, method for fixing the display loop so I am not required to use the system pause would be extremely appreciated.</p>