함수 hex2dec()

(함수 hexdec()에서 넘어옴)
hex2dec()
hexdec()

1 C++[ | ]

#include <iostream> 
using namespace std; 
int main() 
{ 
    cout << stoi("0",     nullptr, 16) << endl;  // 0
    cout << stoi("-a",    nullptr, 16) << endl;  // -10
    cout << stoi("2F",    nullptr, 16) << endl;  // 47
    cout << stoi("-fffe", nullptr, 16) << endl;  // -65534
    cout << stoi("FFFF",  nullptr, 16) << endl;  // 65535
}

2 Java[ | ]

int a = Integer.parseInt("a", 16); // 10
int b = Integer.parseInt("2f", 16); // 47
int c = Integer.parseInt("ffff", 16); // 65535

3 PHP[ | ]

echo hexdec('a');    // 10
echo hexdec('2f');   // 47
echo hexdec('ffff'); // 65535

4 같이 보기[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}