When I'm studying C, I find this program:
#include<stdio.h>
struct Base
{
void* data;
}
int main()
{
struct Base* base = (struct Base*)malloc(sizeof(struct Base));
if(!base) return -1;
int value = 90;
base->data = value;
printf("%d", base->data);
return 0;
}
When compiling, output "warning: assignment to void* from int makes pointer from integer without a cast" How can I solve this problem?