关于strings.h string.h头文件

strings.h头文件是从BSD系UNIX系统继承而来,里面定义了一些字符串函数,如bzero等。这些函数曾经是posix标准的一部分,但是在POSIX.1-2001标准里面,这些函数被标记为了遗留函数而不推荐使用。在POSIX.1-2008标准里已经没有这些函数了。如下:

int bcmp(const void *, const void *, size_t); /* 用memcmp替代 */
void bcopy(const void *, void *, size_t); /* 用memcpy, memmove替代 */
void bzero(void *, size_t); /* 用memset替代 */
int ffs(int); /* string.h 中有 */
char *index(const char *, int); /* 用strchr替代 */
char *rindex(const char *, int); /* 用strrchr替代 */
int strcasecmp(const char *, const char *); /* string.h 中有 */
int strncasecmp(const char *, const char *, size_t); /* string.h 中有 */
 

posted on 2011-07-20 22:03  Nick.Qiu  阅读(888)  评论(0编辑  收藏  举报