I have written code to reverse a string in c... it works fine but I can\'t return the reversed string in the main() function.
main()
#include
use sprintf it will print your reversed string into buffer.
sprintf
#include char *b; main() { char a[17]="abcdefg"; char buffer[17]; buffer[0]= '\0'; b = buffer; reverse(a); printf("%s\n",buffer); } int reverse(char *a) { if(*a!='\0') { reverse(a+1); sprintf(b,"%c",*a); b++; } }