psiko_scweek
May 23rd, 2006, 07:44
ok here it is...
typedef struct robot ROBOT;
struct robot {
char *name;
int energy;
};
int main() {
int i;
ROBOT robots[3];
robots[0].name = "Lunar Lee";
robots[0].energy = 50;
robots[1].name = "Planetary Pete";
robots[1].energy = 20;
robots[2].name = "Martian Matt";
robots[2].energy = 30;
}
(for the most part)
and it keeps giving me the error...
"syntax error before "." token"
i dont understand why...
typedef struct robot ROBOT;
struct robot {
char *name;
int energy;
};
int main() {
int i;
ROBOT robots[3];
robots[0].name = "Lunar Lee";
robots[0].energy = 50;
robots[1].name = "Planetary Pete";
robots[1].energy = 20;
robots[2].name = "Martian Matt";
robots[2].energy = 30;
}
(for the most part)
and it keeps giving me the error...
"syntax error before "." token"
i dont understand why...