Mail Archives: djgpp/1997/03/01/21:25:01
Iain Buchanan (Iain AT BuchananFamily DOT demon DOT co DOT uk) wrote:
: 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));
Hmm. This is using a Gnu C extension (variable sized arrays), which isn't
what you intended. At this stage you are declaring a two dimensional array
of pointers, with size x is one direction and y in the other. Since you've
already defined the array (haven't you?), what you meant was probably:
View[x][y] = (defPt *)calloc(1,sizeof(defPt));
I hope this helps.
--
George Foot <gfoot AT mc31 DOT merton DOT ox DOT ac DOT uk>
Merton College, Oxford.
- Raw text -