Mail Archives: djgpp/1997/03/01/15:24:35
I may be being extremely thick (I don't think so - but then I wouldn't :-),
I'm having this weird problem with DJGPP. (I'm running it from RHIDE) I
started off using large arrays, and found my programmes would crash when I
tried to access the data. I've tried not using pointers, which still had
the same effect. I tried stepping through each of the alloc-type commands,
until I finally got an error from "calloc", which I think is the problem.
I've got a structure as follows:
struct defPt
{
float x, y, z;
int sx, sy;
};
And an array full of pointers to such structres:
defPt *View[25][25];
When I try and do this.... ("x" and "y" are of type int, and each go from
0-24)
defPt *View[x][y] = calloc(1, sizeof(defPt));
I get an error message "Error: variable-sized object of type `defPt
*[1][1]' may not be initialized" I used to use Turbo C and never had any
problems of this sort - surely the structure is pretty fixed size? I've
checked through the documentation and could find nothing. Is there any way
of making it a "fixed size" rather than "variable size"...
Why the hell is it changing in size anyway!?
Thanks. Iain Buchanan
- Raw text -