...
- In C, the lifetime of a return value ends at the next sequence point. Consequently by the time
printf()is called, thestructreturned by theaddressee()call is no longer considered valid, and may have been overwritten. - C function arguments are passed by value. As a result, copies are made of all objects generated by the arguments. For example, a copy is made of the pointer to
"Hello, %s!\n". Under most circumstances, these copies protect one from the effects of sequence points described aboveearlier. - Finally, C implicitly converts arrays to pointers when passing them as function arguments. This means that in the previous point, a copy is made of the pointer to the
addresee().aarray, and that pointer copy is passed toprintf(). But the array data itself is not copied, and no longer exists whenprintf()is called.
...