代码如下:
#include <iostream>
using namespace std;
#define maxSize 100
typedef struct Sqlist
{
int data[maxSize];
int length;
}Sqlist;
int main()
{
void initList(Sqlist & L);
bool listEmpty(Sqlist L);
Sqlist a;
initList(a);
if (listEmpty(a))
cout << "List is empty!" << endl;
return 0;
}
void initList(Sqlist& L)
{
L.length = 0;
return;
}
bool listEmpty(Sqlist L)
{
if (L.length == 0)
return true;
else
return false;
}