The len function provides the length of a text string.
How do I null-terminate a string in C?
The null terminated strings are essentially a series of characters, with a single null character (designated by '0') as the final element. The compiler creates null terminated strings when we write a string enclosed in double quotes ("...").
Why are C strings terminated with null?
Because strings in C are simply a list of characters that can be retrieved using a reference to the cfirst haracter. You need some way to know where the end of the string is because a pointer does not have room to retain the length. It was determined in C that a null character would serve as the indicator for this.
To know more about null-terminated c-string visit;
https://brainly.com/question/15008199
#SPJ4