struct Room room[60];
struct Customer customer[60];
//diancai
struct cai /*cai结构体 实现对菜品 已点份数、名称、原材料 的记录/
{
int fenshu;
char name[50];
int use;
int price;
};
struct List /*该线性表实现对菜品原材料的剩余量的记录,线性表【i】对应菜品的点餐菜单编码*/
{
ElemType* list;
int size;
int MaxSize;
};
/*以下为线性表的函数*/
void InitList(struct List* L,int ms)
{
if(ms<=0){printf("ms 值非法!\n");exit(1);}
L->MaxSize=ms;
L->list=malloc(ms*sizeof(ElemType*));
if(!L->list)
{
printf("动态存储分配失败!");
exit(1);
}
L->size=0;
}
void againMalloc(struct List *L)
{
ElemType *p=realloc(L->list,2*L->MaxSize*sizeof(ElemType));
if(!p){
printf("分配存储空间失败!");
exit(1);
}
求大佬帮忙类型无法转化,怎么办 error C2440: '=' : cannot convert from 'void *' to 'int *'
- 写回答
- 好问题 0 提建议
- 追加酬金
- 关注问题
- 邀请回答
-
1条回答 默认 最新
- threenewbee 2019-05-04 10:06关注
ElemType *p=realloc(L->list,2*L->MaxSize*sizeof(ElemType));
->
ElemType *p=(int *)realloc(L->list,2*L->MaxSize*sizeof(ElemType));本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报
悬赏问题
- ¥15 想问一下树莓派接上显示屏后出现如图所示画面,是什么问题导致的
- ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
- ¥15 cmd cl 0x000007b
- ¥20 BAPI_PR_CHANGE how to add account assignment information for service line
- ¥500 火焰左右视图、视差(基于双目相机)
- ¥100 set_link_state
- ¥15 虚幻5 UE美术毛发渲染
- ¥15 CVRP 图论 物流运输优化
- ¥15 Tableau online 嵌入ppt失败
- ¥100 支付宝网页转账系统不识别账号