Mail Archives: djgpp/2001/04/22/13:15:23
how can i fix this?
can i initialise *p after i do the scanf?
it didnt seem to like that.
or would it be easier to pass an argument to the program and use that
to get n. Id prefer to keep my scanf :)
thanks for the help
-Josh
On Sun, 22 Apr 2001 09:52:12 -0700, Dennis Yelle <dennis51 AT jps DOT net>
wrote:
>The problem is right here:
>> int main()
>> {
>> int i,color,n;
>> // an array of N Points, used to create N-sided polygon
>> //Point *p = (Point *)malloc((n) * sizeof(Point));
>> Point *p = calloc(n, sizeof(Point));
>> Point centroid;
>>
>> allegro_init();
>
>The variable 'n' is passed to calloc before you initialize it.
- Raw text -