我有这个问题与第43行,我不知道为什么错误行:43编译器:预期标识符或“(”前“[”令牌
,如果我不写这条线,误差不会出现,我已经看到了一段代码,我还没有发现它为什么会出现
的错误是在这里
/*for(i=0;i<MAX_ESTACIONES;i++){
Estaciones[i].nobici=10; //the problem is this line
}
*/
,这是代码
#include<stdio.h>
#include<time.h>
#define MAX_ESTACIONES 10
#define MAX_CARACTERES 40
#define MIN_CARACTERES 20
typedef char tipodato;
typedef struct info
{
tipodato nombre[MAX_CARACTERES];
tipodato edad[MIN_CARACTERES];
tipodato sexo[MIN_CARACTERES];
tipodato curp[MIN_CARACTERES];
tipodato domicilio[MAX_CARACTERES];
tipodato nacimiento[MAX_CARACTERES];
tipodato comentario[MAX_CARACTERES];
tipodato contrasenia[MAX_CARACTERES];
int prestamo;
struct info *sig;
}Persona;
typedef struct
{
int nobici;
clock_t inicio,fin;
} Estaciones[MAX_ESTACIONES];
typedef Persona *Listapersona;
Listapersona L;
int main()
{
Persona *posicion;
Persona *P;
P=NULL;
posicion=NULL;
int opcion,salir,i;
salir=0;
for(i=0;i<MAX_ESTACIONES;i++){
Estaciones[i].nobici=10; //the problem is this line
}
return 0;
}
您正在使用哪个IDE? – Netherwire
从第二个'struct'摆脱'typedef' – P0W
我正在使用CodeBlocks – Isidro