str2 output i can't understand | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
5th Sep 2019, 9:21 AM
qin
qin - avatar
3 Answers
+ 2
World string is too short and misses the termination letter \0. My suspicion: Since the words are sitting next to each other in memory, they are read as one string (till the \0 of the first word). (I'm not sure if exactly this would happen on every system. EDIT: According to swim - not. 😁)
5th Sep 2019, 9:28 AM
HonFu
HonFu - avatar
+ 2
Thanks a lot HonFu for your elaborate explanation👍
5th Sep 2019, 9:41 AM
qin
qin - avatar
+ 2
Thanks ~ swim ~ (not available on messanger) for your answer,i get it.
5th Sep 2019, 9:44 AM
qin
qin - avatar