Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/c/68.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C 错误行:43编译器:预期标识符或';(';之前';[';标记_C_Typedef - Fatal编程技术网

C 错误行:43编译器:预期标识符或';(';之前';[';标记

C 错误行:43编译器:预期标识符或';(';之前';[';标记,c,typedef,C,Typedef,我对43号线有这个问题,我不知道为什么 如果我不写那一行,错误就不会出现,我已经看过代码一段时间了,我还没有找到它出现的原因 错误就在这里 /*for(i=0;i<MAX_ESTACIONES;i++){ Estaciones[i].nobici=10; //the problem is this line } */ /*for(i=0;i的typedef使Estaciones成为类型的名称,而不是您想要的变量: typedef struct {

我对43号线有这个问题,我不知道为什么

如果我不写那一行,错误就不会出现,我已经看过代码一段时间了,我还没有找到它出现的原因

错误就在这里

/*for(i=0;i<MAX_ESTACIONES;i++){
        Estaciones[i].nobici=10;     //the problem is this line
    }
*/

/*for(i=0;i的
typedef
使
Estaciones
成为类型的名称,而不是您想要的变量:

typedef struct
{
    int nobici;
    clock_t inicio,fin;
} Estaciones[MAX_ESTACIONES];
删除
typedef
使其成为变量,或使其同时成为类型和变量:

typedef struct
{
    int nobici;
    clock_t inicio,fin;
} TheStructName;

TheStructName Estaciones[MAX_ESTACIONES];

删除
typedef struct…Estaciones[…]
中的typedef。显然,您正试图将
Estaciones
定义为一个类型并将其用作变量。此外,与使用
typedef struct{…}Name;
不同,您应该真正使用
struct Name{…}
现在。

您正在使用哪个IDE?从第二个
struct
中删除
typedef
欢迎使用SO!请使用最少的测试用例。谢谢,现在我了解更多:)谢谢:),现在我了解更多
typedef struct
{
    int nobici;
    clock_t inicio,fin;
} TheStructName;

TheStructName Estaciones[MAX_ESTACIONES];