Convert array of numbers into single Hex value in c -
using 'c' program
i want convert array of numbers single hex value , array mentioned below.
input: `unsigned char no_a[12] = {0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x01,0x02,0x03};
the single number formed above array 123456789123. it's hex equivalent is
0x1cbe991a83`.
expecting output : unsigned char no_b[5] = {0x1c,0xbe,0x99,0x1a,0x83};
i have implemented logic creating single number(123456789123) in long long 64bit(8byte) variable. have restriction without 64bit variable. have idea implement this........?
thanks....
you can solve using 'long arithmetic': represent integers arrays of digits.
converting base-16 require implementing division operation.
Comments
Post a Comment