初始化栈找不到错误
本帖最后由 narutoxyl 于 2014-2-6 12:27 编辑初始化栈中出现 syntax error : missing ')' before ';'是什么原因,如果SIZE直接换成100就可以了,谢谢鱼油!
#include <stdio.h>
#include <stdlib.h>
#define SIZE 100;
typedef int elemtype;
typedef struct
{
elemtype *base;
elemtype *top;
int stacksize;
}spstack;
elemtype *initstack(spstack *s)
{
s->base=(elemtype*)malloc(sizeof(elemtype)*SIZE);
s->top=s->base;
s->stacksize=SIZE;
return s->base;
}
LZ了解下define的用法就知道为什么错了 #define SIZE 100
不要加分号~ 故乡的风 发表于 2014-2-6 22:19 static/image/common/back.gif
LZ了解下define的用法就知道为什么错了
嗯 谢谢啦 小甲鱼 发表于 2014-2-7 17:04 static/image/common/back.gif
#define SIZE 100
不要加分号~
soga,小甲鱼老师 溢出了吗?东东 恩恩,学习了,,,, 虽然不明白,还是支持一下吧!! 谢谢楼主分享!!!!!!!!
页:
[1]