string.h中和strings.h的区别 [英] Difference between string.h and strings.h
本文介绍了string.h中和strings.h的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我注意到,有(至少在Mac OS X)兼具文件string.h
标题和 strings.h
头。 男子3串
显示,它们包含不同的功能。有没有道理呢?
I noticed that there was (at least on Mac OS X) both a string.h
header and a strings.h
header. man 3 string
reveals that they contain different functions. Is there any reason for this?
推荐答案
strings.h来自于Unix的演变BSD分支。其内容已被POSIX规范,但大部分被标记为遗产,并可以与其他功能很容易地更换:
strings.h comes from the BSD branch in the unix evolution. Its content has been standardized by POSIX, but most of it is marked as legacy and can be easily replaced with other functions:
int bcmp(const void *, const void *, size_t); /* LEGACY, see memcmp */
void bcopy(const void *, void *, size_t); /* LEGACY, see memcpy, memmove */
void bzero(void *, size_t); /* LEGACY, see memset */
int ffs(int);
char *index(const char *, int); /* LEGACY, see strchr */
char *rindex(const char *, int); /* LEGACY, see strrchr */
int strcasecmp(const char *, const char *);
int strncasecmp(const char *, const char *, size_t);
这篇关于string.h中和strings.h的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文