Explain this program to reverse an input string:
#include<stdio.h>
#include<conio.h>
#include<string.h>
void main()
{
void reverse(void);
clrscr();
reverse();
getch();
}
void reverse(void)
{
char x;
if((x=getchar())!= '\n')
{
reverse();
}
putchar(x);
}
Do not assume i know about getchar and putchar.
I've got just a bit idea about them but still cant understand the program.
I am familair with recursive functions.
Last edited on