我收到警告:初始化从整数生成指针,而没有在 C 中进行强制转换。什么是强制转换?我应该怎么办?
void UpdateElement(Console* console)
{
DynamicVector* CostList=getAllCosts(console->ctrl);
int i,n;
printf("Give the position of the element you want to delete:");
scanf("%d",&n);
for(i=n-1;i<getLen(CostList);i++)
{
Cost* c=(Cost*)getElementAtPosition(CostList,i);
Cost* c2=AddCost(console); **//here I get the warning**
update_an_element(console->ctrl,c,c2,i);
}
}
Console* initConsole(Controller* ctrl)
{
Console* console=(Console*)malloc(sizeof(Console));
console->ctrl=ctrl;
return console;
}
int createCost(Controller* ctrl, char* day, char* type, int sum)
{
Cost* c=initCost(day,type,sum);
save(ctrl->repo,c);
return c; **//now here I get the warning**
}