How to avoid compiler warning ( long into sprintf %02d)?

sprintf needs to know the variable type:

          sprintf(Text_tmp, "%s%02lu", Text_tmp, tmp_x); // add xx to string

I keep this reference link handy: https://www.cplusplus.com/reference/cstdio/printf/

Is there a good reason for using an unsigned long integer to store a number in the range of 0 to 99, when a byte would do?

1 Like