strrev

来源:互联网 发布:文学理论导论知乎 编辑:程序博客网 时间:2024/06/05 08:58


原型

char *strrev(char *s);


功能

把字符串s的所有字符的顺序颠倒过来


返回值

指向颠倒顺序后的字符串指针


示例

#include <string.h>#include <iostream.h>void main(void){    char sStr[100];    sStr[0] = '\0';    strcpy(sStr,"Golden Global View");    char *p = strrev(sStr); //翻转sStr    cout<<p<<endl;}

结果:

weiV labolG nedloG


0 0
原创粉丝点击