相关疑难解决方法(0)

什么"请求成员'*******'在非结构或联合的东西"是什么意思?

这个错误意味着什么?

request for member '*******' in something not a structure or union
Run Code Online (Sandbox Code Playgroud)

在我学习C的时候,我已经好几次遇到过它,但我还没有弄清楚它意味着什么.

c struct unions

75
推荐指数
3
解决办法
21万
查看次数

请求成员'next'的东西不是结构或联合错误

我在这条线上遇到了问题 c->next=var;

我的职责是:

{
    struct film
    {  
        int id;
        char nom[50];
        char typeFilm[50];
        int duree;
        int dateSortie;
        struct film *next;
    };

#include<stdio.h>
#include<string.h>
#include "structure_film.h"    
#include<stdlib.h>

void ajouter_film(struct film **h,struct film **c)
{
    struct film *var;
    int s, genre;
    do
    {
        var=(struct film*) malloc(sizeof(struct film));        
        printf("quel est le nom du film que vous voulez ajouter ? \n");
        scanf("%s",var->nom);  
        printf("\nquel est le type de ce film \n 1-action \n 2-aventure \n 3-romantique \n 4-comedie \n");
        scanf("%d",&genre);

        switch(genre)
        {
            case 1 : …
Run Code Online (Sandbox Code Playgroud)

c

2
推荐指数
1
解决办法
1万
查看次数

gcc:错误:请求成员'rlen'不是结构或联合

我有一个unsigned char指针,其中包含一个结构.现在我想要执行以下操作

unsigned char *buffer ;

//code to fill the buffer with the relavent information.

int len = ntohs((record_t*)buffer->len);
Run Code Online (Sandbox Code Playgroud)

其中record_t结构包含一个名为len的字段.我无法这样做并且收到错误.

error: request for member ‘len’ in something not a structure or union.
Run Code Online (Sandbox Code Playgroud)

我在这做错了什么?

c gcc pointers gcc-warning

0
推荐指数
1
解决办法
1469
查看次数

标签 统计

c ×3

gcc ×1

gcc-warning ×1

pointers ×1

struct ×1

unions ×1