Hex2Dec

Programing/C언어 | 2009/10/18 05:03 | adioshun
#include< stdio.h >

int Hex2Dec(char ch);

void main()
{
char Hex[3]="4F";
char Ascii;

Ascii = Hex2Dec(Hex[0]) * 16 + Hex2Dec(Hex[1]);
printf("%c",Ascii);
}

int Hex2Dec(char ch)
{
if(ch >= '0' && ch <= '9') return (int)(ch - '0');
if(ch >= 'A' && ch <= 'F') return (int)(ch - 'A' + 10);
if(ch >= 'a' && ch <= 'f') return (int)(ch - 'a' + 10);
return 0;
}
2009/10/18 05:03 2009/10/18 05:03
Trackback address :: http://4ellene.net/tt/trackback/1299

Comments List

Write a comment.

[로그인][오픈아이디란?]