Mail Archives: djgpp/1999/09/13/17:02:41
Tim Chmielewski (tchuma AT sympac DOT com DOT au) wrote:
> I know it's probably against the rules to post code here, but I can't work
> out this problem:
[...]
> CODE:
> void look_ahead(char nasties, int floor, int ty, int &gf)
> {
> char nasties[3] = nasties;
This line 147 of tot.cpp?
> int ty = ty;
> ty = rand() % 1;
> ty = ty * 3 + 1;
> char what[10] = "";
> what = nasties[ty];
I assume this line is number 153 in tot.cpp, right?
In that case, there are at least two errors in 'tot.cpp':
> tot.cpp: In function `void print_flrrm(int, int, int, int, int)':
> tot.cpp:147: parse error before `{'
This means that in function prnt_flrrm(), at least one closing '}'
brace is missing, somewhere. gcc didn't expect a new function to begin
here, as it didn't see the previous one being ended.
> tot.cpp:153: `nasties' undeclared (first use this function)
> tot.cpp:153: (Each undeclared identifier is reported only once
> tot.cpp:153: for each function it appears in.)
This is a follow-up error from the missed start of a new function.
The other genuine error is your declaration
char nasties[3] = nasties;
You cannot redefine one of the functions parameters with the same
name, I think. Nor can you assign a char to a char [3] array and
expect anything sensible to come out of it.
--
Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de)
Even if all the snow were burnt, ashes would remain.
- Raw text -