mirror of
https://github.com/fofolee/uTools-Manuals.git
synced 2025-06-08 06:55:36 +08:00
35 lines
720 B
HTML
35 lines
720 B
HTML
<h1>字符串函数 - setmem</h1>
|
||
|
||
|
||
<p>原型:extern void setmem(void *buf, unsigned int count, char ch);</p>
|
||
|
||
<p>用法:#include <string.h></p>
|
||
|
||
<p>功能:把buf所指内存区域前count个字节设置成字符ch。</p>
|
||
|
||
<p>说明:返回指向buf的指针。</p>
|
||
|
||
举例:<pre>
|
||
|
||
|
||
// setmem.c
|
||
|
||
#include <syslib.h>
|
||
#include <string.h>
|
||
|
||
main()
|
||
{
|
||
char *s="Golden Global View";
|
||
|
||
clrscr();
|
||
|
||
setmem(s,6,'G');
|
||
printf("%s",s);
|
||
|
||
getchar();
|
||
return 0;
|
||
}
|
||
|
||
</pre>相关函数:<a href="bzero.html">bzero</a>,<a href="memset.html">memset</a>,<a href="strset.html">strset</a>
|
||
|