I am kind of a beginner in C++,started learning the language this year at university.
The next day I have an exam.One of the problems that needs to be solved with C++ includes a making a program that by entering a any word(Ex.:"Table")would reverse it,so it would look like :"Elbat".
I seem to have found some reasonable solutions on the net,but the problem is that it included stuff that i haven't learned yet,like Vectors and some else.
Now i would like someone to help me find solution to my problem.All i know is that commands like: .length and .at should be used.
I would appreciate any help,thanks in advance.
Marijan
0
Newbie Poster
Recommended Answers
Jump to Post>> would appreciate any help,thanks in advance
Post the code you have written so far. If all you have to do is display the reversed string on the screen then create a loop that starts at the end of the string and decrement the loop counter until it reaches 0, …
Jump to PostIf you are required to use std::strings, I'll give you a hint:
#include <iostream> #include <string> using namespace std; int main() { string str = "abc"; cout << str[0] << endl; cin.get(); return 0; }
Now if you combine this with a loop and .length, you should …
All 5 Replies
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
Nick Evan
4,005
Industrious Poster
Team Colleague
Featured Poster
Marijan
0
Newbie Poster
Nick Evan
4,005
Industrious Poster
Team Colleague
Featured Poster
Marijan
0
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.