mirror of
https://github.com/fofolee/uTools-Manuals.git
synced 2025-06-08 15:04:05 +08:00
37 lines
767 B
HTML
37 lines
767 B
HTML
<h1>字符串函数 - strrev</h1>
|
||
|
||
|
||
<p>原型:extern char *strrev(char *s);</p>
|
||
|
||
<p>用法:#include <string.h></p>
|
||
|
||
<p>功能:把字符串s的所有字符的顺序颠倒过来(不包括空字符NULL)。</p>
|
||
|
||
<p>说明:返回指向颠倒顺序后的字符串指针。</p>
|
||
|
||
|
||
举例:<pre><code class="language-c">
|
||
|
||
|
||
// strrev.c
|
||
|
||
#include <syslib.h>
|
||
#include <string.h>
|
||
|
||
main()
|
||
{
|
||
char *s="Welcome To Beijing";
|
||
|
||
clrscr();
|
||
textmode(0x00); // 6 lines per screen
|
||
|
||
printf("%s\n%s",s,strrev(strdup(s)));
|
||
|
||
|
||
getchar();
|
||
return 0;
|
||
}
|
||
|
||
</code></pre>相关函数:无
|
||
|