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