-->

atoi() from hex representation string

2019-01-24 00:35发布

问题:

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?

回答1:

Try to use strtol():

strtol("FA", NULL, 16);


标签: c atoi