我抄书的一个程序 主函数不会写 求大神指点 刚开始学数据结构 什么都不懂 跪求指点

没有主函数的其他部分

#include<stdio.h>
#include<stdlib.h>
#define MAXQSIZE 100

typedef int ElemType; /*定义链队列类型*/
typedef struct node
{
ElemType data;
struct node * next;
}qlink;
typedef struct
{
qlink * front;
qlink * rear;
}linkqueue;

void intqueue(linkqueue * LQ) /*初始化链队列*/
{
LQ->front=LQ->rear=(qlink * )malloc(sizeof(qlink));
LQ->front->next=NULL;
}

void enqueue(linkqueue * LQ,ElenType x) /*把元素x插入队列的后端*/
{
qlink * p;
p=(qlink * )malloc(sizof(qlink));
p->data=x;
p->next=NULL;
LQ->rear-.next=p;
LQ->rear=p;
}

int outqueue(linkqueue * LQ,ElemType * e) /*删除队列的第一个元素*/
{
qlink * p;
if(LQ->front==LQ->rear)
return 0;
p=LQ->front->next;
* e=p->data;
LQ->front->next=p->next;
if(LQ->rear==p)
LQ->rear=LQ->front;
free(p);
}

int emptyqueue(linkqueue * LQ) /*判定队列是否为空*/
{
if(LQ->front==LQ->rear)
return 1;
else return 0;
}

希望各位大神不吝赐教 帮忙看看 写一下主函数
都是抄书的 球指点

#include<stdio.h>
#include<stdlib.h>
#define MAXQSIZE 100

typedef int ElemType;                     /*定义链队列类型*/
typedef struct node
{
    ElemType data;
    struct node * next;
}qlink;
typedef struct
{
    qlink * front;
    qlink * rear;
}linkqueue;

void intqueue(linkqueue * LQ)                   /*初始化链队列*/
{
    LQ->front=LQ->rear=(qlink * )malloc(sizeof(qlink));
    LQ->front->next=NULL;
}

void enqueue(linkqueue * LQ,ElemType x)          /*把元素x插入队列的后端*/
{
    qlink * p;
    p=(qlink * )malloc(sizeof(qlink));
    p->data=x;
    p->next=NULL;
    LQ->rear->next=p;
    LQ->rear=p;
}

int outqueue(linkqueue * LQ,ElemType * e)        /*删除队列的第一个元素*/
{
    qlink * p;
    if(LQ->front==LQ->rear)
        return 0;
    p=LQ->front->next;
    * e=p->data;
    LQ->front->next=p->next;
    if(LQ->rear==p)
        LQ->rear=LQ->front;
    free(p);
}

int emptyqueue(linkqueue * LQ)                   /*判定队列是否为空*/
{
    if(LQ->front==LQ->rear)
        return 1;
    else return 0;
}
void showqueue(linkqueue *LQ)
{
qlink* p = LQ->front->next;
while(p!=LQ->rear)
{
printf("%d ",p->data);
p = p->next;
}
printf("%d\n",p->data);
}
void main()
{  
int val;
linkqueue Q;
    intqueue(&Q);
    enqueue(&Q,1);
enqueue(&Q,2);
enqueue(&Q,3);
    showqueue(&Q);
outqueue(&Q,&val);
printf("删除:%d\n",val);
    showqueue(&Q);
}

温馨提示:答案为网友推荐,仅供参考