How to put a HEX in the String?

Hi, I trying to put a hex data in a string, and I not find a good process do do it and using a stm32.

Example of hex data:

 x = 2BF2;

sprintf

issacarbrunow:
Hi, I trying to put a hex data in a string, and I not find a good process do do it and using a stm32.

Define "hex data".

x = 2BF2;

issacarbrunow:

x = 2BF2;

Try again.

AWOL:
sprintf

Thanks!

I note that the thread title refers to a String (uppercase S) and the original post refers to a string (lowercase s)

Which is it ?
A String (an object created using the String library) or a string (a null terminated array of chars)

issacarbrunow:

x = 2BF2;

That’s not hex. That’s a compile error. Can you give us a real example?

Hex numbers start with 0x and that variable x needs a type.