早教吧 育儿知识 作业答案 考试题库 百科 知识分享

43syntaxerrorbefore`;'eventmessaget*Receive.receive(messaget*msg,void*payload,uint8tlen){40testsendmsgt*btrpkt;41if((len==sizeof(testsendmsgt))&&(TOSNODEID==1)){42recFlags=TRUE;43memcpy(btrpkt,(testsendmsgt

题目详情
43 syntax error before `;'
event message_t *Receive.receive (message_t *msg,void *payload,uint8_t len) {
40 test_send_msg_t * btrpkt;
41 if ( (len == sizeof(test_send_msg_t)) && (TOS_NODE_ID == 1) ) {
42 recFlags = TRUE;
43 memcpy(btrpkt,(test_send_msg_t*)payload,sizeof(test_send_msg_t);
44 printf("listening the message %d \n",btrpkt->count);
45 showDate = btrpkt->number>>2;
46 showDate |= btrpkt->colour;
47 call Update.change(&showDate);
48 }
49 }
▼优质解答
答案和解析
memcpy(btrpkt,(test_send_msg_t*)payload,sizeof(test_send_msg_t); 这行最右边少了括回去的小括号啊