I need help with this C++  code to reverse this given string.

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter7: Characters, Strings, And The Stringbuilder
Section: Chapter Questions
Problem 12RQ
icon
Related questions
Question

I need help with this C++  code to reverse this given string.

write C++ code to reverse a given string. look at at() function is c++ string class to make your life easier.
#include <string>
void swap(char& a, char& b) {
}
void reverse_string(std::string& s)
{
}
int main() {
std::string ss("this is my bike");
reverse_string(ss);
std::cout<<ss<<std::endl;
return 0;
}
Transcribed Image Text:write C++ code to reverse a given string. look at at() function is c++ string class to make your life easier. #include <string> void swap(char& a, char& b) { } void reverse_string(std::string& s) { } int main() { std::string ss("this is my bike"); reverse_string(ss); std::cout<<ss<<std::endl; return 0; }
Expert Solution
steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
ADT and Class
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning