reverse

How to write a function reverse(s) that reverses the character string s
LoraAsked:
Who is Participating?
 
mcglincheyConnect With a Mentor Commented:
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
 
LoraAuthor Commented:
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
 
nietodCommented:
_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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.