菜鸟向大神求助
写了一个简易的表顺序存储结构插入函数如下:
#include<stdio.h>
#define MAXSIZE 100
typedef int ElemType;
typedef struct SeqList
{
ElemType elem[MAXSIZE];
int next;
}SeqList;
typedef SeqList *pSeqList;
void listInsert(pSeqList s,int p,ElemType e)
{
if(p<0||p>=MAXSIZE)
printf("越界!");
int i;
for(i=s->next-1;i>=p;i--)
s->elem[i+1]=s->elem[i];
s->elem[p]=e;
s->next++;
}
编译时出现: syntax error : missing ';' before 'type'';
'i' : undeclared identifier;
但注销if()和printf那两行却能通过编译,请各位大神指教为啥呢?
[解决办法]
什么编译器。
[解决办法]
拷贝你的代码编译完,没有错误。。。
[解决办法]
是不是分号打成中文了