strset函数
函数原型:extern char *strset(char *str, char character)
#include <string.h>
#include <stdio.h>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
int main()
{
char str[100]="I'm sky2098,welcome to my website!";
char *strtemp;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
strtemp=strset(str,'k'); //将字符串str中所有
字符替换为字符k
printf("The string strtemp is: %s ",strtemp);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return 0;
}
参数说明:str为源字符串,即将要被操作的字符串,character为一个字符。
所在库名:#include <string.h>
函数功能:将字符串str中所有的字符都设置成为指定的字符character。
返回说明:返回所有字符都设置为character后的字符串的指针。
其它说明:暂时无。
实例:
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
在VC++ 6.0 编译运行:
Keep it simple!