I have a simple question.
Why is it necessary to consider the terminating null in an
array of chars (or simply a string) and not in an array of integers. So when i want a
Null terminators are required at the end of strings (or character arrays) because:
NUL
character (ASCII 0x00) is used to designate the end of strings. Hence why it's also used as an EOF character when reading from ASCII files or streams.Technically, if you're doing your own string manipulation with your own coded functions, you don't need a null terminator; you just need to keep track of how long the string is. But, if you use just about anything standardized, it will expect it.