Life is Good.

Enhance Tech and English
随笔 - 65, 文章 - 20, 评论 - 21, 引用 - 0
数据加载中……

8 - strset

/***
*char *_strset(string, val) - sets all of string to val
*
*Purpose:
*       Sets all of characters in string (except the terminating '/0'
*       character) equal to val.
*
*
*Entry:
*       char *string - string to modify
*       char val - value to fill string with
*
*Exit:
*       returns string -- now filled with val's
*
*Uses:
*
*Exceptions:
*
******************************************************************************
*/

char * __cdecl _strset (
  
char * string,
  
int val
  )
{
  
char *start = string;

  
while (*string)
    
*string++ = (char)val;

  
return(start);
}

posted on 2011-06-11 21:09 Mike Song 阅读(250) 评论(0)  编辑 收藏 引用 所属分类: C字符串函数源码分析


只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理