我正在使用 strcmp,如下所示。
我正在调试这些值,这些值是相同的,但仍然没有使该条件成立。
const char opcode_read[2] = {'0', '1'};
rc = recvfrom(s, blk_receive_full, sizeof (blk_receive_full), 0,(struct sockaddr FAR *)&sin, &fromlength);
if(rc == -1){
printf("failed: recvfrom, \n No data received \n failed code: %d\n",WSAGetLastError());
cleanup();
exit(1);
}
memcpy(blk_receive_opcode, &blk_receive_full, 2);
if (strcmp(blk_receive_opcode, opcode_data) == 0) {
}