What is the code for a loop that iterates from the end of a string toward the beginning?
A) string::reverse_iterator i{s.begin() }; while (i != s.end() )
{
Cout << *i;
++i;
}
B) string::reverse_iterator i{s.rbegin() }; while (i != s.rend() )
{
Cout << *i;
++i;
}
C) string::reverse_iterator i{s.end() }; while (i != s.begin() )
{
Cout << *i;
--i;
}
D) string::reverse_iterator i{s.rbegin() }; while (i != s.rend() )
{
Cout << *i;
--i;
}
Correct Answer:
Verified
Q18: The total number of elements that can
Q19: Which of the following cannot be used
Q20: Which of the following would not return
Q21: Which of the following provides bounds checking?
A)
Q22: Which of the following does not apply
Q23: Which of the statements a), b) and
Q24: Which of the following statements about C++11's
Q25: String iterators:
A) Must be dereferenced in order
Q27: All of the following are true of
Q28: The capabilities of inputting and outputting strings
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents