I got this warning "warning: assignment makes integer from pointer without a cast"! I want to figure out what does it mean? And what i need to change in my fucntion create_rectangle..... Thank you. Any help appreciated
struct point {
int x;
int y;
};
struct rectangle {
struct point upperleft;
struct point lowerright;
char label[NAMESIZE + 1];
};
and my code:
struct rectangle *create_rectangle(struct point ul, struct point lr,
char *label) {
struct rectangle *r = malloc(sizeof(struct rectangle));
r->upperleft=ul;
r->lowerright=lr;
r->label[NAMESIZE+1]= strncpy(r->label,label,NAMESIZE);
//here is the warning
r->label[NAMESIZE] = '\0';
return r;
}