How do I take an string and reverse its order. (ie abc to cba) using getchar() and putchar(). I can read it using the following code.
c = getchar();
while(c != EOF)
{
codeWriter(c);/*This converts the string to a code*/
c = getchar();
}
The output is in this function.
char codeWriter(char c)
{
switch(c)
{
case 'A':
{
c = 'b';
putchar(c);
break;
}
.
.
.
How do I reverse the order of the string