Converting Hexadecimal String to Decimal Integer

后端 未结 14 1998
感动是毒
感动是毒 2020-12-09 16:02

I wrote some code to convert my hexadecimal display string to decimal integer. However, when input is something like 100a or 625b( something with letter) I got an error like

14条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-09 16:49

    void htod(String hexadecimal)
    {
        int h = hexadecimal.length() - 1;
        int d = 0;
        int n = 0;
    
        for(int i = 0; i

提交回复
热议问题