Well here is my program to reverse a string.
Please tell where am i doing wrong?Code:#include <stdio.h> #include <string.h> void xstrrev(char *s, char *s1); int main() { char s[]="srini"; char s1[10]; xstrrev(s,s1); return 0; } void xstrrev(char *s, char *s1) { int len,i; len=strlen(s); while(*s!='\0') s++; s--; for(i=len;i>=0;i--) { *s1=*s; len--; s--; s1++; } *s1='\0'; printf("%s",*s1); }