We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Why does sprintf() append a null?
Why not? According to the standard, 'A null character is written at the end of the characters written' by sprintf. - Mike
because that's the way strings work in 'C'!
My apologies. My text, "A Book on C", did not mention this. Thanks for your responses.
"My text, 'A Book on C', did not mention this" Oh dear - the null termination is absolutely fundamental to the operation of all the string-handling functions in the Standard Library!! You'll be in big trouble if it's missing...!