-
switch case/structure...
Well, I'm having some problems:
code extract:
Code:
switch(race)
{
case 'O':
{
stats.fp=40;
stats.dp=35;
stats.speed=3;
break;
}
case 'E':
{
stats.fp=30;
stats.dp=30;
stats.speed=30;
break;
}
case 'H':
{
stats.fp=35;
stats.dp=25;
stats.speed=30;
break;
}
the compiler problems are all
parse error before '.' token
on the lines after the { in each switch case
Code:
struct stats
{
int fp;
int dp;
int speed;
};
Here is my structure
-
Alright. Thanks. I've never used structures before. I just thought they might come in handy :P