in reply to Solved : decimal to hex in an array
Well, you only convert even elements to hexadecimal, 345 is not even so it does not get converted to 159 (or actually 0x159).
I don't understand how you expect 2 to not be converted to 0x2 though.