![]() |
I'm getting parse errors
This is a simple program, but keep in my my knowledge of C is also very simple. I'm getting parse errors in two areas in this program, and I'm not sure why:
----------------------------- Code:
typedef enum {There are probably other problems in this programs as well, but Dev isn't pointing them out. Any help would be greatly appreciated. :) |
Re: I'm getting parse errors
that first sentence should say "keep in mind my", not "keep in my my". Is there a way to edit posts here?
|
Re: I'm getting parse errors
There's a "Before you make a query" thread. Did you happen to read that before you made your query? If so, what didn't you understand about code tags? Typos are much easier to ignore than ugly code which has lost its indentation and formatting.
|
Re: I'm getting parse errors
Sorry, I didn't see that thread. I'm still having trouble finding it, but here's a better looking version of the code:
Code:
typedef enum {now=10, next, last} grade; |
Re: I'm getting parse errors
Quote:
|
Re: I'm getting parse errors
You're being sloppy with your choice of labels. For instance, the typedef makes "age" a type, equivalent to "union {int age1 ;float age2;}". then you write, "union age = ....". Would you write "union union {int age1 ;float age2;}" and expect to NOT get a parse error? Precisely what were you expecting to assign "info.age" to?
Would you want to come back in a year's time and deal with lebenty-four variables with the same name, even if you managed to maintain correct syntax? Are you shooting for obfuscation or cuteness, or just not paying attention? Just curious. |
| All times are GMT +5.5. The time now is 12:34. |