?
Solved

reverse

Posted on 2000-03-02
3
Medium Priority
?
200 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 10 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

Independent Software Vendors: 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

What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
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.

765 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