simple c++ program for "abcde123ba" convert "ab321edcba"
with out using string

Answer Posted / pramod

void mystrrev(char* str)
{
char ch;
int last=strlen(str)-1;
for(int i=0;i<last;i++,last--)
{
ch=str[i];
str[i]=str[last];
str[last]=ch;
}
}

Is This Answer Correct ?    5 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is input operator in c++?

586


What are the types of array in c++?

616


In a function declaration, what does extern mean?

635


What is a template in c++?

634


What is a float in c++?

542






What is c++ flowchart?

674


What is virtual table?

614


What is virtual base class?

567


Why do we use iterators?

617


why and when we can declar member fuction as a private in the class?

1597


How do you declare a set in c++?

531


Difference between class and structure.

707


Can you use the function fprintf() to display the output on the screen?

660


What is one dimensional array in c++?

575


Explain method of creating object in C++ ?

590