i made the strrev function myself.while compling it says that the code in the func xstrrev() has no effect.i would also like to know that while making a copy of the built in funtion for assignments can we use builtinfunctions(other) in it?as i used strlen() in it.
#include<stdio.h>
#include<conio.h>
#include<string.h>
void xstrrev(char str[]);
void main(void)
{
char str[30];
printf("Enter a string:");
gets(str);
xstrrev(str);
printf("\n%s",str);
getch();
}
void xstrrev(char str[])
{
int i,x;
x=strlen(str);
for(i=0;;i++)
{
if(str[i]=='\0')
{
break;
}
str[x-i]=str[i];
}
}