Please I want your help to write a C language code that print the Hexadecimal in for of string.
I was thing to do some thing like this :
main()
{
char hex[]={ "00", "01", "02", "03", "04", "05", "06", "07", "08", "09", "0A", "0B", "0C", "0D", "0E", "0F",..................., "FF"};
int Hex;
printf("\nEnter the Hex No.\n");
scanf("%d",&Hex);
printf("\n String value is:");
printf("%c",hex[Hex]);
}
But I got error from my compiler when I try to implement it in the initializing the string matrix , so could you tell me what is the problem or you may have better idea for this ??
Best regards