-
strrev
鎖定
strrev用於反轉字符串。strrev屬於非標準函數,部分編譯器不予支持。
- 外文名
- strrev
- 原 型
- extern char *strrev(char *s)
- 用 法
- #include
- 功 能
- 顛倒字符串s的所有字符的順序
- 説 明
- 返回指向顛倒順序後的字符串指針
strrev舉例
//strrev.c #include<syslib.h> #include<string.h> main() { char*s="WelcomeToBeijing"; clrscr(); textmode(0x00);//6linesperscreen printf("%s\n%s",s,strrev( strdup(s))); getchar(); return0; } strrev( PHP4, PHP5) strrev—Reverseastring //PHP <?php echostrrev(" HelloWorld!"); ?>
strrev説明
string strrev ( string $string )
Returns string , reversed.
strrev參數
string The string to be reversed.
strrev返回值
Returns the reversed string.
strrev範例
Example#1 Reversing a string with strrev()
char str[] = "Hello world!";
printf("%s","strrev(str)); // outputs "!dlrow olleH"; str[] = "!dlrow olleH";
- 詞條統計
-
- 瀏覽次數:次
- 編輯次數:16次歷史版本
- 最近更新: 豪雨豪庭好痛