By adding the return statement you pass the ownership of the string back to main. The unmodified function just took the ownership of the string and deallocated it after printing. Hope this helps
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
replies: