Solved

reverse

Posted on 2000-03-02
3
186 Views
Last Modified: 2012-05-04
How to write a function reverse(s) that reverses the character string s
0
Comment
Question by:Lora
3 Comments
 

Author Comment

by:Lora
ID: 2577119
If you can give me please answer on this question
how to write a program that will remove trailing blanks and tabs from each line of input and to delete entirely blank lines
0
 

Accepted Solution

by:
mcglinchey earned 5 total points
ID: 2577208
To reverse a string, just do something like:

main() {
char szOriginal[50];
char szNew[50];

strcpy(szOriginal, "My input");

strcpy(szNew, _strrev(szOriginal));
printf(szNew);
}

The output will be:
tupni yM



0
 
LVL 22

Expert Comment

by:nietod
ID: 2577562
_strev is not a standard C++ function.  If this is not for VC it probably is not available.

Furthermore if this is for an accademic assignment, then the instructor probably doesn't want it done with a library function, the student should be doing it him/herself.  And if it is for an assignment, you cannot _give_ the answer.   That is grounds for removal from EE.  You can only provide reasonable assistance.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

896 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now