#2
Weken2015-04-19 19:55
|
下面为代码:
程序代码:
include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define SIZE 1008
#define LIST_INIT_SIZE 100
#define LISTINCREMENT 10
#define OK 1
#define ERROR 0
typedef int ElemType;
typedef int status;
typedef struct
{
ElemType *elem;
int length;
int listsize;
} SqList; //初始化
status InitList_Sq(SqList &L) // 编译器提示此处的‘&’出错
{
//构造一个空的线性表L
L.elem = (ElemType*)malloc(LIST_INIT_SIZE*sizeof(ElemType));
if(!L.elem)
{
exit(0);
}
L.length = 0;
L.listsize = LIST_INIT_SIZE;
return OK;
} [/b]
#include <stdlib.h>
#include <string.h>
#define SIZE 1008
#define LIST_INIT_SIZE 100
#define LISTINCREMENT 10
#define OK 1
#define ERROR 0
typedef int ElemType;
typedef int status;
typedef struct
{
ElemType *elem;
int length;
int listsize;
} SqList; //初始化
status InitList_Sq(SqList &L) // 编译器提示此处的‘&’出错
{
//构造一个空的线性表L
L.elem = (ElemType*)malloc(LIST_INIT_SIZE*sizeof(ElemType));
if(!L.elem)
{
exit(0);
}
L.length = 0;
L.listsize = LIST_INIT_SIZE;
return OK;
} [/b]
编译器提示错误如下:
[Error] expected ';', ',' or ')' before '&' token
求教呀,问题在哪??我用的编译器为Dev c++