+ 3
How to make a string without '\0'?
A pointer was declared to have 2 chars and initialized but I still found '\0' as a third character.(please refer to the code). How to make a string without '\0'? https://code.sololearn.com/cRtza0op5CLI/?ref=app
3 Antworten
+ 4
When dealing with cpp unlike c stackoverflow looked at it
https://stackoverflow.com/questions/42874699/stdstring-stops-at-0
my example is a bit different than Coder Kitten but also addresses the use of '\0'
https://code.sololearn.com/c9Sr2TJsMcs9/?ref=app
+ 4
Probably because the rest of the memory either contains or is initialised to 0 and 0 is the ASCII value of '\0'.
+ 3
Another interesting thing to notice is that it doesn't only print 'yes' for index 2 but for all values.