But from the article I have read: 3 is wrong too. I am really confused.
) Fairly Easy. What is wrong with the following function? Explain.
return "Bill Clinton";
Answer: The string "Bill Clinton" is allocated on the stack and thus deallocated when the function returns. The function returns a pointer that cannot be trusted, aka a bad pointer.
This post has been archived. It cannot be replied.