I have this code-fragment out of my programm:
typedef struct board_t{
int x_pos;
int y_pos;
int size;
int counter;
int** field;
};
int func(struct board_t* b){
[...]
int i;
for(i=b->size; i>=1; i--){
int y;
for(y=b->size; y>=b->size; y--){
b->field[i][y] = (int*)malloc(sizeof(int)); //warning here
if(b->field[i][y] == NULL){
printf("Failed to save memory...");
return 1;
}
}
}
}
field is a 2-dimensional array from type double-pointer. Now I get a warning "assignment makes integer from pointer without cast". Could someone explain this to me and how to fix it?