On Lecture 36 there is a Warning

Hey everyone,

When I typed the code as Ben I have seen a Warning. It says “unnamed objects with custom construction and destruction (es.84).” for the “getGuess();” line. Probably it is not that important but I want to understand why this is happening. I will be appreciated if you can help me.

Because the function is returning a std::string and not using it, so it’s being created unnamed and then immediately destroyed. It would be solved in the next lecture when the return value is actually used, i.e.

std::string Guess = GetGuess();

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms