Cosmic STM8 sprintf
Hello all!
I'm using stvd and Cosmic (free) C compiler and I'm having issues with a simple statement. I'm using sprintf to conver two uint8_t to string but it always do it wrong.
uint8_t u8Hours = 22, u8Minutes = 31;
uint8_t u8DisplayBuffer[6];
sprintf(u8DisplayBuffer, ''%.2u%.2u'', u8Hours, u8Minutes );
the result is an array with ''5663''
♯♯♯
I have tried everything on my mind but I can't figure it out what is happening, do you have some idea what can be wrong?
Thanks in advanced,
Best regards, Mauro.
#sprintf #stm8 #cosmic