Can someone please tell me why rules is passing a warning from incompatible pointer type and why there is a Segmentation Fault in the second for loop (the one with the y)
Here is the code that actually pertains to my question, thanks in advance to all who help.
Code:
fractalDraw(int depthFract, double angle, double iAngle, char *axiom, char **rules, double *x, double *y);
int main(){
double *x, *y;
bmp = bmp_create(300, 300, 32);
for(*x = 0; *x < 300; *x = *x + 1){
for(*y = 0; *y < 300; *y = *y + 1){
bmp_set_pixel(bmp, *x, *y, pixelB); //assume this works correctly (it does)
}
}
int numFract, i, depthFract, numRules, j, count = 0;
double angle, iAngle;
char axiom[10], rules[123][10], tbr, rhs[10];
scanf("%d", &numFract);
for(i = 0; i < numFract; i++){
scanf("%d", &depthFract);
scanf("%lf", &angle);
scanf("%lf", &iAngle);
scanf("%s", &axiom);
scanf("%d", &numRules);
for(j = 0; j < numRules; j++){
scanf("%s -> %s",&tbr,&rhs);
strcpy(rules[tbr],rhs);
}
}
fractalDraw(depthFract, angle, iAngle, axiom, rules, x, y);
bmp_save(bmp, "OUTPUT.BMP");
bmp_destroy(bmp);
return 0;
}