我尝试使用外部结构,但是当我编译我的 c 代码时,我收到了这条消息:
subscripted value is neither array nor pointer nor vector
.
为什么?
消息传递.h
struct Request {
struct {
u_int data_len;
float *data_val;
} data;
bool_t last;
};
typedef struct Request Request;
主程序
#include "messaggio.h"
int main(void){
struct Request x;
x.data[0] = 4.6;
printf("%f\n",x.data[0]);
return 0;
}