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?

有帮助吗?

解决方案

Try to use strtol():

strtol("FA", NULL, 16);
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top