Q:

The following function, although legal, is less useful than it might be. Identify and correct the limitation on this function

0

The following function, although legal, is less useful than it might be. Identify and correct the limitation on this function:

bool is_empty(string& s) { return s.empty(); }

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

The parameter of the function should be `const string &s`. So that we can pass string literals or const strings to the function.

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now