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
What are the two types of comments, and how do they differ?
Which programming language is best?
What is the difference between structures and unions?
What is the difference between object-oriented programming and procedural programming?
What is the cout in c++?
How can a struct in c++ differs from a struct in c?
What is the use of "new" operator?
What you know about structures in C++?
How can virtual functions in c++ be implemented?
What is class invariant in c++?
What are separators in c++?
Why is it called c++?
How do we implement inheritance in c++?
If a base class is an adt, and it has three pure virtual functions, how many of these functions must be overridden in its derived classes?
Which is the best c++ compiler for beginners?