本文共两块内容:
一、函数名
二、练习
一、strncmp //比较数组长度
结构体:long strncmp(char s1[], char s2[], long len); // form 1
long strncmp(char s1[], char s2[], long s2offset, long len); // form 2
结构体说明:
s1 First string
s2 Second string
s2 offset Offset in s2 in bytes //此处不是很清晰为何有此参数
len Maximum number of bytes to compare
返回值:lenth s1 = lenth s2 → strncmp = 0
lenth s1 > lenth s2 → strncmp = 1
lenth s1 < lenth s2 → strncmp = -1
二、练习:截止于2023/2/2