Q:

Is the following range for legal? If so, what is the type of c

0

Is the following range for legal? If so, what is the type of c?

const string s = "Keep out!";
for (auto &c : s) { /* ... */ }
C++

All Answers

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

The range `for` is legal. The type of `c` is `const char &`.

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