主函数.cpp:
#include
using namespace std;
#define LIST_INIT_SIZE 100 //存储空间初始分配
#define LISTINCREMENT 10 //存储空间分配增量
typedef struct
{
char num[5];
char name[10];
char xing[5];
char phone[15];
char call[15];
char mail[25];
}ElemType;
typedef struct {
struct ElemType *elem;
int length;
int listsize;
} SqList;
int main()
{
int i,n,m;
SqList L;
InitAddressBook(L)
cout <<"请输入员工人数:"<
cin >>n;//下面用for循环输入n个人的信息
函数.h:
void InitAddressBook(SqList &L) //初始化顺序表
{ L.elem= (ElemType*)
malloc(LIST_INIT_SIZE *sizeof(ElemType));
L.length=0;
Listsize= LIST_INIT_SIZE;
}
各位大神 在main函数用L.elem.name是对的吗 感觉有些问题 又不知道在哪里 刚学数据结构做第一个实验 谢谢帮忙哈~