size_t _strlen(const char *str)
{
if(str==NULL || *str == '\0') return 0;
size_t count = 0;
while(*str++)
{
count++;
}
return count;
}
void reverse_str(char *str)
{
if(str==NULL) return;
size_t len = _strlen(str);
char *p1 = str;
char *p2 = str + len - 1;
while(p1<p2)
{
char c = *p1;
*p1 = *p2;
*p2 = c;
}
}