#include <stdio.h>
#include <string.h>
 
void reverse(char *p) {
    char c, *p1, *p2;
    for (p1=p, p2=p+strlen(p)-1; p1<p2; c=*p1, *p1=*p2, *p2=c, p1++, p2--);
}
 
/**test**/
int main() {
    char p[4] = {'a','b','c','\0'};
    reverse(p);
    puts(p);
    return 0;
}

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-02-09
  • 2022-12-23
  • 2022-12-23
  • 2021-09-13
  • 2021-11-11
  • 2021-09-03
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-08
  • 2022-12-23
  • 2022-02-21
相关资源
相似解决方案