memcmp和strcmp差别

            

#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <pthread.h>
#include <semaphore.h>
#include <unistd.h>
#include <signal.h>
#include <string.h>

static char usbcmd[] = {0x11,0,13,0,15};
static char recevecmd[] = {0x11,0,13,14,15};
//memcmp int memcmp(const void *str1, const void *str2, size_t n)

int main()
{
    //
    char ret = memcmp(usbcmd,recevecmd,5);
    printf("ret memcmp is %d\n",ret);
    ret = strcmp(usbcmd,recevecmd);
    printf("ret strcmp is %d\n",ret);

    for(;;);
    return 0;
}

  

posted @ 2020-09-13 11:48  卷哭你  阅读(753)  评论(0编辑  收藏  举报