Here is the struct:
function protocolCode:struct circle_t { int x, y, r; int color; int xs, ys; int dx, dy; };
function call in main functionCode:struct circle_t * circle_init(int new_x, int new_y, int new_radius, int new_color, int new_xs, int new_ys);
function definitionCode:for (i = 0; i < 10; i++) circles[i] = circle_init(rand() % SCREEN_W, rand() % SCREEN_H, rand() % 25, rand() % 256, rand() % 5, rand() % 5);
Code:struct circle_t * circ_init;program works up to hereCode:circ_init->x = new_x;
As soon as it goes to this line:
I get a segmentation faultCode:circ_init->y = new_y;



LinkBack URL
About LinkBacks


