?
Solved

reverse

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
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.

755 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