sas24 de Septiembre del 2008
Preguntaumm...veran, este es mi codigo fuente. El asunto es que compila pero me aparece este caracter: ¡ a que se debe si no he invocado a ese caracter en el codigo???
#include <string.h>
#include <stdio.h>
#include <ctype.h>
/**Este metodo valida si el rut ingresado son solo numeros */
int main(){
/**He aqui la variable rut en formato char para hacer corroboraciones*/
char rut[7];
int i=0;
printf("Ingrese RUT: ");
scanf("%s", &rut[7]);
/*Para validar esto se ocupa la funcion isdigit*/
while(rut[i]!=7) {
if( isdigit(rut[i])==0){
printf("%c, %dn", rut[i], isdigit(rut[i]));
printf("RUT INVALIDO, ingrese otro: ");
scanf("%s", &rut[7]);
}
else
i++;
}
return 0;
getchar();
}
#include <string.h>
#include <stdio.h>
#include <ctype.h>
/**Este metodo valida si el rut ingresado son solo numeros */
int main(){
/**He aqui la variable rut en formato char para hacer corroboraciones*/
char rut[7];
int i=0;
printf("Ingrese RUT: ");
scanf("%s", &rut[7]);
/*Para validar esto se ocupa la funcion isdigit*/
while(rut[i]!=7) {
if( isdigit(rut[i])==0){
printf("%c, %dn", rut[i], isdigit(rut[i]));
printf("RUT INVALIDO, ingrese otro: ");
scanf("%s", &rut[7]);
}
else
i++;
}
return 0;
getchar();
}
