数据结构
typedef struct GOBJ{
bool hoving;
int width;
int height;
int x;
int y;
IMAGE_PNG img;
}GOBJ;
typedef struct STACK{
int msize; // max size
int top; // stack top
GOBJ* st; // stack arr
}STACK;
// 顺序栈初始化
void arrStk(STACK* st,int size){
st->st = (GOBJ*)malloc(sizeof(GOBJ*)*size);
st->msize = size;
st->top = -1;
};
bool arrStkPush(STACK* st,GOBJ* gobj){
if(st->top == st->msize-1){
printf("the stk is full");
return false;
}else{
st->top = st->top + 1;
st->st + st->top = gobj; //!!!本行报错(~ ̄(OO) ̄)ブ
return true;
}
};
编译过程中报错:error C2106: '=' : left operand must be l-value
环境:vc++6 (作业要求)
求解麻烦了。
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…