Hello all. I’m an utter newbie to C, and I am using a third-party library to display characters on a 7-segment display. The library is SevSeg by Dean Reading, on GitHub at GitHub - DeanIsMe/SevSeg: Seven segment display controller library for Arduino .
The library allows display of characters and digits, and I’m using the library to display an output of mixed characters and digits, but the limitation is that if I choose to display characters, I must choose to display the entire output as characters. Which means, converting integers to characters.
The library uses an array of characters, instead of a string. That’s just the way the library is written.
What I am hoping to do, is replace the last two characters in the array with two integers.
The example provided by the library developer uses strcpy to load the character array, like this:
** **strcpy(displaystring, " C.59");** **
and the output would be:
** ** C.59** **
on the seven-segment display.
The syntax to display is this:
** ** sevseg.setChars(displaystring);** **
wherein displaystring isn’t a string, it’s an array of chars.
So, how would I replace the
[b]59[/b] in that example with two characters from a two-digit integer?