title: Reversing a string in c with recursion
body: <p>I have written code to reverse a string in c... it works fine but I can't return the reversed string in the <code>main()</code> function.</p>
  
  <pre><code>#include&lt;stdio.h&gt;
  
  main()
  {
    char a[17]="abcdefg";
    reverse(a);
    printf("\n");
    system("PAUSE");
  }
  int reverse(char *a)
  {
     if(*a!='\0')
     {   
       reverse(a+1);
     }
     printf("%c",*a);
  }         
  </code></pre>
  
  <p>it prints the reversed string but I want the reversed string in <code>main()</code>. How can I do this?       </p>