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 a reference variable in C++?
Can we define function inside main in c++?
When should we use container classes instead of arrays?
In c++, what is the difference between method overloading and method overriding?
How delete [] is different from delete?
What is the identity function in c++? How is it useful?
What are friend classes?
What is the auto keyword good for in c++?
What is the main function c++?
What is c++ runtime?
What is the difference between set and map in c++?
How would you call C functions from C++ and vice versa?
If horse and bird inherit virtual public from animal, do their constructors initialize the animal constructor? If pegasus inherits from both horse and bird, how does it initialize animal’s constructor?
What is c++ flowchart?
What is stoi in c++?