simple c++ program for "abcde123ba" convert "ab321edcba"
with out using string
Answer Posted / prasenjit roy
#include "stdio.h"
int main(int argc, char* argv[])
{
char sBuffer[]="abcde123ba";
char sBuff[100];
char *pStr = sBuffer;
int i;
puts(sBuffer);
while(*pStr != '\0')
++pStr;
for ( i = 0; pStr != sBuffer; i++,pStr--)
sBuff[i] = pStr[-1];
sBuff[i] = '\0';
puts(sBuff);
return 0;
}
| Is This Answer Correct ? | 5 Yes | 1 No |
Post New Answer View All Answers
What is the best c++ book for beginners?
How can virtual functions in c++ be implemented?
Why can’t you call invariants() as the first line of your constructor?
What is the difference between *p++ and (*p)++ ?
What is the v-ptr?
What is a far pointer? where we use it?
Is main a class in c++?
daily Routine of father
Do vectors start at 0 c++?
Who invented turbo c++?
Explain what are mutator methods in c++?
What are the advantages of using a pointer? Define the operators that can be used with a pointer.
What is a catch statement?
What is conditions when using boolean operators?
Why namespace is used in c++?