Starting from
char tval[20] = "temp:26.62";
how can I add a space character until tval
is filled? I need that in the end to obtain this:
char tval[20] = "temp:26.62 ";
Like this, probably
size_t prevlen = strlen(tval);
memset(tval + prevlen, ' ', 19 - prevlen);
*(tval + 19) = '\0';
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With