#include "stdafx.h"
#include
#define SIZE 100
#define TRUE 1
#define FALASE 0
#define OK 1
#define ERROR 0
#define INFEASIBLE -1
#define OVERFLOW -2
typedef Datetype char
typedef struct{
Datatype *elem;
int length;
int size;
}sqlist;
Status Initlist(sqlist *l)
{
l->elem=(Datatype *)malloc(SIZE*sizeof(Datatype));
if(!l->elem)
exit(OVERFLOW)
l->length=0;
l->size=SIZE;
return OK;
}
void main()
{
splist l;
Initlist(*l);
}
这个程序有问题
报错error C2236: unexpected 'struct' '__unnamed'
C:\Program Files\Microsoft Visual Studio\MyProjects\Dome2\Dome2.cpp(14) : error C2143: syntax error : missing ';' before ''
C:\Program Files\Microsoft Visual Studio\MyProjects\Dome2\Dome2.cpp(14) : fatal error C1004: unexpected end of file found
#define SIZE 100
#define TRUE 1
#define FALASE 0
typedef enum Status
{
OK = 1,
ERROR1 = 0,
INFEASIBLE = -1,
OVERFLOW = -2,
};
typedef char Datatype;
typedef struct
{
Datatype *elem;
int length;
int size;
}sqlist;
Status Initlist(sqlist *l)
{
l->elem=(Datatype *)malloc(SIZE*sizeof(Datatype));
if(!l->elem)
exit(OVERFLOW);
l->length=0;
l->size=SIZE;
return OK;
}
void main()
{
sqlist l;
Initlist(&l);
}