void Get_Instructions(u8 Ins,double param,u8 str) { int i,j,n; u8 temp[30]; i=0; j=0;…
- User
void Get_Instructions(u8 *Ins,double *param,u8 *str) { int i,j,n; u8 temp[30]; i=0; j=0; n=0;
codememset(Ins,0,32); memset(param,0,32); memset(temp,0,32); while((str[i]!='\0')&&(str[i]!=' ')) { Ins[i]=str[i]; i++; } Ins[i]='\0'; while(str[i]!='\0') { j=0; while(str[i]==' ')i++; while((str[i]!='\0')&&(str[i]!=' ')) { temp[j]=str[i]; i++; j++; } param[n]=atof((char *)temp); memset(temp,0,32); n++; }} 我如何利用这个函数去处理传入的数据 比如 Realy_1_1 或者Realy_2_0 这样子的 处理1或者2代表继电器位号 1和0代表开和关
Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.