DOUBT:
suppose a memory space of 16B is given and it is asked that what is the maximum length of string it can store.
then do we have to consider the space taken by the “\0” also?
OR just the string length?
I think yes because it differentiate the two strings like iitbiitd here is two string so we have to take extra space to differentiate between them that is called null “\0”
iitb\0iitd\0
…………..
yes it differentiate two strings but null terminating character does not take any space. and null terminating character also take space.
so for 16B it can store a maximum 15B length of string right? and 1B for NULL .
@Abhrajyoti00 no difference.
@Abhrajyoti00 no actually it can store 16B of maximum length of string.
now after 6 byte it get overflow.
64.3k questions
77.9k answers
244k comments
80.0k users