Solved

reverse

Posted on 2000-03-02
3
199 Views
Last Modified: 2012-05-04
How to write a function reverse(s) that reverses the character string s
0
Comment
Question by:Lora
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
  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 video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
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.

707 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