一、把0x1234转成1234d
unsigned long int i=0x1234;
sprintf( (void*)&i,"%x",i);
i = atoi((void*)&i);
printf("i=%d",i);
二、把1234d转成0x1234
unsigned long int i = 1234;
sprintf( (void*)&i, "%d",i);
sscanf((void*)&i,"%x", (void*)&i);
printf("i=%x",i);
posted on 2006-05-31 12:34
游子 阅读(1593)
评论(0) 编辑 收藏 引用 所属分类:
软件