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;
}


d. string::reverse_iterator i{s.rbegin()};
while (i != s.rend())
{
cout << *i;
--i;
}

Computer Science & Information Technology

You might also like to view...

YouTube is a popular ________ website

Fill in the blank(s) with correct word

Computer Science & Information Technology

Describe block special files used in Linux.

What will be an ideal response?

Computer Science & Information Technology

____ is a specialized agency of the United Nations and attempts to resolve international commercial disputes about intellectual property between private parties.

A. WIPO B. DRM C. OLPC D. USPTO

Computer Science & Information Technology

What encryption protocol was designed as more of an integrity check for WEP transmissions rather than a sophisticated encryption protocol??

A. ?Kerberos B. ?TKIP C. ?AES D. ?EAP

Computer Science & Information Technology