MQTT to IR

thanks a lot for your replies it really helped me simplifying the code ..but my problem is not yet solved ... i tried strtoul() , but it converts the string to respective base , but i need the same data which is in string i.e the exact HEX code in undefined int or some other data type to sent it to ir receiver pin.. i.e

irsend.sendRC6(hex, 24);
delay(2000);

the 'hex' in the above code cannot be a string or const char* .... it must be a hex code in undefined long or something.

Thank you