diff options
Diffstat (limited to 'src/c/string/strrev/gstrreva.c')
-rw-r--r-- | src/c/string/strrev/gstrreva.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/c/string/strrev/gstrreva.c b/src/c/string/strrev/gstrreva.c new file mode 100644 index 0000000..8ceb16a --- /dev/null +++ b/src/c/string/strrev/gstrreva.c @@ -0,0 +1,15 @@ +#include<stdio.h> +#include "strrev.h" + +void gstrreva(char* str,int size,char* out) +{ + int i=-1,j=0; + + while(str[++i]!='\0'); + + while(i>=0) + out[j++] = str[--i]; + + out[j]='\0'; + +} |