在main.c中的main方法(int main(int argc, const char * argv[]) {})调用此方法,并且进行判断
#include "QueueLinkControl.h"
int main(int argc, const char * argv[]) {
//创建链队列
LINKQUEUE *LQ=(LINKQUEUE *)malloc(sizeof(LINKQUEUE));
LQ=initLinkQueue(LQ);
//向链队插入结点
LQ=inLinkQueue(LQ,'a');
LQ=inLinkQueue(LQ,'b');
LQ=inLinkQueue(LQ,'c');
LQ=inLinkQueue(LQ,'d');
printLinkQueue(LQ);
//删除结点--从队头
LQ=outLinkQueue(LQ);
LQ=outLinkQueue(LQ);
printLinkQueue(LQ);
return 0;
}
打印结果:
in link queue success!
in link queue success!
in link queue success!
in link queue success!
queue={#,a,b,c,d}
out link queue success!
out link queue success!
queue={#,c,d}
Program ended with exit code: 0
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持ASPKU。
注:相关教程知识阅读请移步到C++教程频道。










