title: How to make for loop break when no value entered for first name
body: <p>I can not get my code to break at the first name, It will only break after i have left all values blank. </p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdbool.h&gt;
  #include &lt;string.h&gt;
  
  
  void main(void) { //Start main function
  
      // Declare variables
      char charTempArray[50] = "";
      char charFirstNames[50][50];
      char charLastNames[50][50];
      char charTempSal[10] = "";
      int intSalaries[50];
      int intSalarySum = 0;
      int intSalaryAvg = 0;
      int intSalaryTop = 0;
      int intSalaryBot = 9999999999;
      int intArraySize = 0;
      int i = 0;
      int intCharConv = 0;
  
      //User input to build the arrays
      for(i = 0; i &lt; 50; ++i)
          if (charFirstNames[i - 1][0] != '\0') {
              printf("Please enter Employees first name.\n ");
              gets(charTempArray);
              strcpy(charFirstNames[i], charTempArray);
              printf("Please enter Employees last name.\n ");
              gets(charTempArray);
              strcpy(charLastNames[i], charTempArray);
              printf("Please enter Employees salary.\n ");
              gets(charTempSal);
              intCharConv = atoi(charTempSal);
              intSalaries[i] = intCharConv;
              intArraySize = i;
          }
          else {
              break;
          }
  </code></pre>
  
  <p>Here is the output.</p>
  
  <pre><code>Please enter Employees first name.
   test
  Please enter Employees last name.
   me
  Please enter Employees salary.
   100
  Please enter Employees first name.
  
  Please enter Employees last name.
  
  Please enter Employees salary.
  
  Teacher 1: test me      Salary(per year):100
  
  The average salary is:100 per year
  The top salary is 100
  The bottom salary is 100
  Press any key to continue . . .
  </code></pre>