c语言引用头文件出错,error c2143
写得头文件是这样的:
程序代码:#define MAXSIZE 1024
typedef int DATATYP;
#include <stdio.h>
typedef struct numbers
{
DATATYP data[MAXSIZE];
int last;
} seqlist;
//建立线性表函数,以-1结尾
void Initlist(seqlist &scores)
{
int count=0;
int tempnum;
printf("Please Type in scores ended with -1:\n");
scanf("%d",&tempnum);
while (tempnum!=-1)
{
scores.data[count]=tempnum;
count++;
scanf("%d",&tempnum);
}
scores.last=count;
}
//插入函数,在数组的第i个数字前插入数字getin
void Insert(seqlist &a,int i,DATATYP getin)//getin插入的数据,i为插入在第i个数字前面
{
int k;
if (i>a.last)
{
printf("The list is not long enough,but the number has Inserted into the last one!\n");
a.data[a.last]=getin;
a.last++;
}
else if(i>0&&i<=a.last)
{
for (k=a.last;k>=i;k--)
a.data[k]=a.data[k-1];
a.data[k]=getin;
a.last++;
}
else
printf("Error Data!\n\a");
}
//起泡法排序
void renew(seqlist &a)
{
int i,k,j=0,temp;
for(i=a.last-1;i>0;i--)
for (k=0;k<a.last-1;k++)
{
if(a.data[j]>a.data[j+1])
{
temp=a.data[j+1];
a.data[j+1]=a.data[j];
#include "linelink.h"
void main()
{
DATATYP i;
seqlist A;
Initlist(A);
renew(A);
for(i=0;i<A.last;i++)
printf("%-4d",A.data[i]);
} a.data[j]=temp;}
}
}//这个是源程序
为什么会出现这样的问题呀
说是error C2143: syntax error : missing ')' before '&'在头文件的这行出错了。。
void Initlist(seqlist &scores)求解啊。。










hehe

呵呵