我需要 C 中指针的帮助。我必须从文件中读取,并用指向 struct rcftp_msg 的指针填充数组。从现在开始我做了接下来的事情:
struct rcftp_msg {
uint8_t version;
uint8_t flags;
uint16_t len;
uint8_t buffer[512];
};
struct rcftp_msg *windows [10];
pfile = fopen(file,"r"); // Open the file
I have to read from the file into the buffer, but I don't know how to do it.
I tried the next:
for (i = 0; i <10; i++){
leng=fread (**windows[i]->buffer**,sizeof(uint8_t),512,pfile);
}
我认为windows[i]->buffer不好,因为它不起作用。
对不起,我的英语不好 :(