title: Fill missing user input with zeros
body: <p>I have a function that parses user input into the correct overloaded function. My &quot;parseUserInput&quot; function determines if the user entered a character, a floating-point, or an integer array. Then it calls the overloaded function to ultimately determine the average grade. The problem I am facing is, when I enter an integer array, I want to ensure if the user doesn't enter 5 integers, that the rest get filled in with zeros.</p>
  <p>Example: &quot;55 66 98 32 87&quot; would work.</p>
  <p>Example: &quot;55 66&quot; would not work... I want the compiler to understand the missing variables should be auto-filled to zero, such as .... &quot; 55 66 0 0 0&quot;.</p>
  <p>Any thoughts on how I can do this?</p>
  <pre><code>   void parseUserInput(char *userInput)
      {
          int array[ASSGN_MARK];
      
          /* other code ... */
      
          else if (sscanf(userInput, &quot;%i %i %i %i %i&quot;, &amp;array[0], &amp;array[1], &amp;array[2], &amp;array[3], &amp;array[4]))
          {
              printf(&quot;&gt;&gt; This input should be directed to the &lt;&lt; assessGrade(int[]) &gt;&gt; function ...\n&quot;);
              assessGrade(array);
          }
      
         /* other code...*/
     }
  
  
  
  //Overloaded Function
  void assessGrade(int array[ASSGN_MARK])
  {
      int total = 0;
      int sum = 0;
      
  
      sum = array[0] + array[1] + array[2] + array[3] + array[4];
  
      total = sum / ASSGN_MARK;
  
      //being type-casted to a double, as I'm calling the next overloaded function
      //and that overloaded function will display if the student passed or failed
      assessGrade((double)total);
  }
  </code></pre>