Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int hexKey(char digit,int power)
- {
- int arr[]={0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15},i;
- char digitList[]={'0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f'};
- for(i=0;i<16;i++)
- {
- if(digitList[i]==digit)
- return arr[i]*pow(16,power);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment