与atoi()从十六进制再presentation串 [英] atoi() from hex representation string
本文介绍了与atoi()从十六进制再presentation串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
需要从十六进制再presentation字符串INT像0xFA回应
或更好FA
。需要像的atoi(FA)
。是否有任何的标准解决方案是什么?
Need to make int from hex representation string like "0xFA"
or better "FA"
. Need something like atoi("FA")
. Is there are any standard solutions for that?
推荐答案
尝试使用与strtol()
strtol("FA", NULL, 16);
这篇关于与atoi()从十六进制再presentation串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文