How to avoid the danger of destroying your code when passing by reference?

I got this question today for a quiz and i cant seem to understand what he meant can anyone help?
That question makes no sense at all.
^
Do not create a pointer to the referenced object where the lifetime of the pointer is longer than the lifetime of the referenced object.

I.e. if a reference to an object is passed as a parameter to a function, the pointer to that object must not leave the function.
I suspect he means "how to avoid the danger of destroying your data when passing by reference."
The answer is pass by const reference instead.
Topic archived. No new replies allowed.