Reverse a string in C language?

reverse (char *p) { char c, *p1, *p2;

if (strlen(p) <= 1) return; for (p1=p, p2=p+strlen(p)-1; p1<p2; c=*p1, *p1=*p2, *p2=c, p1++, p2--); }