title: C programming: How to continue input to array from certain element
body: <p>So, basically, this is just a part of the complete program. What I'm trying to do here (but not really succeeding) is to input 10 values into my array. So, when I press 'e', I'm able to input values into my array until I enter 0. What I want to do is to be able to continue from where I left off in my array. Meaning if I entered values into my first three elements, the next time I press 'e', I want to continue from element four and when it gets up to 10 values, I can't input any more values. I've tried some if statements and different loops but can't seem to get it right. I'm still very new to this so any help would be appreciated!</p>
  
  <p>Here is my code</p>
  
  <pre><code>int main(void)
  {
  
  char choice;
  
  printf("Measurement tool 1.2\n");
  loadMenu(choice);
  
  return 0;
  }
  
   void loadMenu(char theChoice)
          {
              int values[X]= {0}; 
              float counter = 0.0f;
              int i;
              do
              {
                          printf("VECRQ? ");
                          scanf(" %c",&amp;theChoice);
  
  
                              switch(theChoice)
                              {
                                  case 'v':
                                  printf("[");
  
                                  for(i=0; i&lt;X; i++)
                                      {
                                      printf("%d ",values[i]);
                                      }
  
                                  printf("]\n");
                                  break;
  
                                  case 'e': 
                                  scanValue(values);
                                  break;
  
                                  case 'c':
                                  maxmin(values, counter);
                                  average(values, counter);
                                  normValue(values);
                                  break;
  
                                  case 'r':
                                  for(i=0; i&lt;X; i++)
                                  {
                                      values[i] = 0;
                                  }
                                  printf("Measurement values cleared!\n");
                                  break;
  
                                  case 'q':
                                  printf("Exit measurement tool!\n");
                                  break;
  
                                  default:
                                  printf("Wrong character! Choose between VECRQ.\n");
                              }
              } while(theChoice != 'q');
  
  
          }
  
  void scanValue(int theValues[])
  {
  int i; int j=0;
  
      {   
      for(i=0;i&lt;X;i++)
      {
          printf("Enter measurement %d (or 0):",i+1);
          scanf("%d",&amp;theValues[i]);
          j=i;
          if(theValues[i]==0)
              break;
      }
  
  
  
              for(j; j&lt;X; j++)
              {
              printf("Enter measurement %d (or 0):\n",j+1);
                  scanf(" %d",&amp;theValues[j]);
  
                  if(theValues[j]==0)
                      break;
              }
  
   }
  </code></pre>