strncmp( )函数返回值是什么#include #include int main(void) { char *buf1 = "aaabbb", *buf2 = "bbbccc", *buf3 = "ccc"; int ptr; ptr = strncmp(buf2,buf1,3); if (ptr > 0) printf("buffer 2 is great
来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/27 14:08:04
strncmp( )函数返回值是什么#include #include int main(void) { char *buf1 = "aaabbb", *buf2 = "bbbccc", *buf3 = "ccc"; int ptr; ptr = strncmp(buf2,buf1,3); if (ptr > 0) printf("buffer 2 is great
strncmp( )函数返回值是什么
#include #include int main(void) { char *buf1 = "aaabbb", *buf2 = "bbbccc", *buf3 = "ccc"; int ptr; ptr = strncmp(buf2,buf1,3); if (ptr > 0) printf("buffer 2 is greater than buffer 1\n");
strncmp( )函数返回值是什么#include #include int main(void) { char *buf1 = "aaabbb", *buf2 = "bbbccc", *buf3 = "ccc"; int ptr; ptr = strncmp(buf2,buf1,3); if (ptr > 0) printf("buffer 2 is great
自己查一下,网上有的!
函数名:strncmp
功 能:串比较
用 法:int strncmp(char *str1,char *str2,int maxlen);
说明:此函数功能即比较字符串str1和str2的前maxlen个字符.如果前maxlen字节完全相等,返回值就=0;在前maxlen字节比较过程中,如果出现str1[n]与str2[n]不等,则返回(str1[n]-str2[n]).