title: i++ not working inside a while loop
body: <p>I'm helping a friend with her programming class, and we've come across something funny. We have the code:</p>
  
  <pre><code>void ingresardatos(struct alumno *lista){
  int i=0;
  char continuar='s';
  while(continuar=='s' &amp;&amp; i&lt;20){
      printf("Valor de i al iniciar: %d  \n", i);
      printf("Introduzca el nombre del alumno:\n");
      scanf("%s",&amp;(lista[i].nombre));
      printf("Introduzca la matricula:\n");
      scanf("%s",&amp;lista[i].matricula);
      printf("Introduzca la primera calificacion:\n");
      scanf("%f",&amp;lista[i].calf1);
      printf("Introduzca la segunda calificacion:\n");
      scanf("%f",&amp;lista[i].calf2);
      printf("Introduzca la tercera caificacion:\n");
      scanf("%f",&amp;lista[i].calf3);
  
      lista[i].prom=(lista[i].calf1+lista[i].calf2+lista[i].calf3)/3;
  
      if(lista[i].prom&lt;=5.9){
         strcpy(lista[i].nota,"NA");
      }
      else if(lista[i].prom&gt;=6 &amp;&amp; lista[i].prom&lt;=7.3){
         strcpy(lista[i].nota,"S");
      }
      else if(lista[i].prom&gt;=7.4 &amp;&amp; lista[i].prom&lt;=8.6){
        strcpy(lista[i].nota,"B");
      }
      else if(lista[i].prom&gt;=8.7 &amp;&amp; lista[i].prom&lt;=10){
         strcpy(lista[i].nota,"MB");
      }
      printf("Valor de i antes: %d \n", i);
      i++;
      printf("Valor de i después: %d \n", i);
      printf("¿Desea continuar? (S/N)");
      scanf("%s",&amp;continuar);
  }
  }
  </code></pre>
  
  <p>It's supposed to be a grade list for a class of 20; you introduce the student's data until you press "n", and it saves them on a list. Now, I figured out the pointer part (I just really know Java, so it's kinda weird working on C), but what I can't figure out is how to make the <code>i++</code> part work. If you run it like it is, it'll start with <code>i=0</code> on the first pass, then go through all the code, and finally do <code>i++</code> before asking if you want to continue (it prints it on the screen). But then, when you press "s" to indicate you want to continue, it'll start with <code>i=0</code> again, and for the life of me I can't figure out why. I tried <code>i++</code>, <code>++i</code>, <code>i=i+1</code>, and so on, but nothing seems to work. I even tried making <code>i</code> a pointer, but Windows didn't like it and crashed my program every time I ran it.</p>
  
  <p>If someone could explain just why it isn't working, I'd be eternally grateful.</p>