Not only terminating null character, but it can write anything past the end. It's strongly recommended to not use it at all. Instead snprintf() must be used.
Tesla, Thanks for your answer. Please help me get around this problem. Here is my current code. char char One_LCD[1], Two_LCD[], Three_LCD[]; uint8_t Gain; // Gain is always a single digit value sprintf (One_LCD,"%1d",Gain); // I think you told me that this pollutes Two_LCD OLED_countDraw (1,1,66,One_LCD); OLED_countDraw is a program I wrote for STM32L4 chips to draw characters on an OLED graphic display The above code will draw a 6 by 8 character on line 1 of 4 lines starting at the 66th place on 128 place line. It is my way of placing characters at specified places on a graphic display. How do I keep the sprint code above from polluting the Two_LCD space? Would the following code display the correct Gain and not pollute Three_LCD? sprintf (Two_LCD,"%1d",Gain); OLED_countDraw (1, 1, 66, Two_LCD); Jerry Bonner
Tesla, I do not understand your reaction. I said "WOW" because i liked your response and followed that with a "Thanks". I apologize to you if if you think I responded to your answer in a negative way. I meant my response to be a "Thank You".
Thanks to all the answers. Am looking at all of them. There is evidently more than one way to solve my problem. I am investigating to determine which approach to take. Thanks again to all who answered, including you, Tesla.