I\'m trying to reverse a string using pointers.When i try to print the reversed string instead of getting DCBA i\'m getting out only as BA?Can anyone help me on this?
char* strrev(chr* src) { char* dest int len=0, index=0 , rindex=0; while(*(src+len) != '\0') { len++ } rindex=len-1; while(rindex > =0) { *(dest+index) = *(src + rindex) index++; rindex--; } *(dest+index) = '\0'; return dest; }