Ver Mensaje Individual
  #4 (permalink)  
Antiguo 01/12/2008, 14:38
Lorenag
 
Fecha de Ingreso: diciembre-2008
Mensajes: 2
Antigüedad: 15 años, 5 meses
Puntos: 0
Respuesta: programa que nofunciona

Hola, soy nieva en esto de la programacion en c, pero necesito un programa que me convierta de ascci a hexadecimal o decimal, buscando en la web encontre este programa que aparentemente lo hace,pero nolo he podido correr porq alcompilarlo me aparcen 2 errores y no doy porq? por favor alguien q me pueda ayudar.gracias

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
main()


{
char string[1024];
int length;
printf("ASCII Input: ");
gets(string);
printf("\n");
printf("\n");
printf("Decimal Ouput:");
for(length = 0; length < strlen(string); length++)


{
printf("%d ", string[length]);
}
printf("\n");
printf("Hexadecimal Output: ");
for(length = 0; length < strlen(string); length++)


{
printf("%x ", string[length]);
}
printf("\n");
printf("Octal Output:");
for(length = 0; length < strlen(string); length++)


{
printf("%o ", string[length]);
}
printf("\n");
printf("\n");
system("pause");
return 0;
}