narutoxyl 发表于 2014-2-6 12:26:33

初始化栈找不到错误

本帖最后由 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;

}

故乡的风 发表于 2014-2-6 22:19:29

LZ了解下define的用法就知道为什么错了

小甲鱼 发表于 2014-2-7 17:04:55

#define SIZE 100

不要加分号~

narutoxyl 发表于 2014-2-8 20:28:23

故乡的风 发表于 2014-2-6 22:19 static/image/common/back.gif
LZ了解下define的用法就知道为什么错了

嗯 谢谢啦            

narutoxyl 发表于 2014-2-8 20:28:56

小甲鱼 发表于 2014-2-7 17:04 static/image/common/back.gif
#define SIZE 100

不要加分号~

soga,小甲鱼老师

yuzhouliu2000 发表于 2014-2-28 11:53:14

溢出了吗?东东

枫界易城 发表于 2014-2-28 12:16:46

恩恩,学习了,,,,

zunhuazhy 发表于 2014-2-28 12:50:10

虽然不明白,还是支持一下吧!!

cable5881 发表于 2014-8-12 10:15:25

谢谢楼主分享!!!!!!!!
页: [1]
查看完整版本: 初始化栈找不到错误