Since this is homework, I'm not going to give a straight solution to the problem.
First I am confused what you mean by splitting an "integer". It looks like (from the examples) that you wish to split a hexadecimal number, not a decimal number. Either way, think of how a number is built: 123 = 1*100 + 2*10 + 3*1 = 1*10^2 + 2*10^1 + 3*10^0. How would you separate the 1 from the 2 and the three? (hint, use the opposite of the multiplication.) (Another hint, if it's in hexadecimal, remember to change your base from 10 to 16)
Assume now that you have split the digits into separate variables. Well, the ascii table constructed in a very "convenient" way. Look up the table, and find the ascii values for the digits you want. From there, it will be a simple constant addition/subtraction to get the ascii representation of the digits.
(Another hint) I assume you mean to convert from an int
into a char
. Remember the bits are just data. You have the ability to change the representation of data. Search "casting int to char".