小编All*_*bhu的帖子

如何在C中将字符串转换为十六进制值

我有字符串"6A"我怎么能转换成十六进制值6A?

请帮我解决C语言的问题

我试过了

char c[2]="6A"
char *p;
int x = atoi(c);//atoi is deprecated 

int y = strtod(c,&p);//Returns only first digit,rest it considers as string and
//returns 0 if first character is non digit char.
Run Code Online (Sandbox Code Playgroud)

c string hex

8
推荐指数
1
解决办法
5万
查看次数

标签 统计

c ×1

hex ×1

string ×1