#include <string.h>
int memcmp(const void *s1, const void *s2, size_t n);
#include <stdio.h>
#include <string.h>
int main(void)
{
char line[1024] = {"hello world"};
char name[1024] = {"hello"};
printf ("compare result is : %d\n", memcmp (line, name, 5));
return 0;
}
$ ./memcmp
compare result is : 0
欢迎光临 曲径通幽论坛 (http://www.groad.net/bbs/) | Powered by Discuz! X3.2 |