strncmp函数

来源:互联网 发布:无网络远程监控 编辑:程序博客网 时间:2024/05/02 00:30

strncmp函数模型


int strncmp ( const char * str1, const char * str2, size_t num );

作用:
比较字符串str1和str2的大小,如果str1小于str2,返回值就<0,反之如果str1大于str2,返回值就>0,如果str1等于str2,返回值就=0,len指的是str1与str2的比较的字符数。此函数功能即比较字符串str1和str2的前len个字符。

0 0