Ver Mensaje Individual
  #3 (permalink)  
Antiguo 29/10/2005, 12:08
Smithy
 
Fecha de Ingreso: septiembre-2005
Mensajes: 32
Antigüedad: 19 años, 5 meses
Puntos: 0
Hola, Eternal Idol, gracias por tu respuesta, el bucle me funciono perfecto. Aunque yo había leído en este sitio http://home.golden.net/~uberkermit/c...er_input.shtml que usar fflush(stdin) no era correcto:

Cita:
There are ways to deal with clearing the stdin when using scanf(), some are good, some are mediocre. Some methods are completely incorrect. We will only discuss the latter briefly. It is incorrect to use the fflush() function in this way:

fflush(stdin);

Many people believe that using fflush() in this manner is an effective way to clear the input stream, however the C standard states that fflush() is intended for the output stream, (stdout), and as such, if it is used with the stdin the behaviour is undefined, meaning it might work the way you want it to, or it might do something else. If you have been taught to use fflush(stdin), know that it is incorrect.
Por eso quisiera usar la funcion clearbuf(); no es un capricho es que me dijeron que la tenía que implementar en algun lado xD, pero no se donde invocarla.