While trying to reverse a string of characters using the mentioned program, the string reverses only till half. I don't know where the problem is occuring
void reverse(char *s)
{
char *t=s;
while(*t)
t++;
t--;
while(*s)
{
char temp=*t;
*s++=*t;
*t--=temp;
}
}
int main()
{
char s[100];
gets(s);
reverse(s);
cout<<s;
return 0;
}