停车场管理系统设计源代码

停车场管理系统设计源代码

ID:853249

大小:97.03 KB

页数:15页

时间:2017-09-20

停车场管理系统设计源代码_第1页
停车场管理系统设计源代码_第2页
停车场管理系统设计源代码_第3页
停车场管理系统设计源代码_第4页
停车场管理系统设计源代码_第5页
资源描述:

《停车场管理系统设计源代码》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库

1、附录源代码1.头文件Car.h#ifndefCAR#defineCAR#includeusingnamespacestd;typedefstructNode{void*data;structNode*link;}nodeS;typedefstructSta{nodeS*top;intcount;}Stack;typedefstructNodeQ{void*dataptr;structNodeQ*next;}nodeQ;typedefstructQueues{intcount;nodeQ*front

2、;nodeQ*rear;}Que;Stack*Createstack();void*pop(Stack*stack);voidpush(Stack*stack,void*data);voidDestroyStack(Stack*stack);Que*CreateQueue();voidEnqueue(Que*queue);void*Dequeue(Que*queue);voidDestroyqueue(Que*queue);#endif1.实现文件Car.cpp#include"Car.h"Stack*Creates

3、tack(){Stack*stack;stack=newStack;if(stack==NULL)returnNULL;stack->count=0;stack->top=NULL;returnstack;}voidpush(Stack*stack,void*data){nodeS*node;node=newnodeS;if(node==NULL

4、

5、stack==NULL)return;node->data=data;node->link=stack->top;stack->top=node;stack->count

6、++;}void*pop(Stack*stack){void*data;nodeS*node;node=newnodeS;if(stack->count==0)returnNULL;data=stack->top->data;node=stack->top;stack->top=node->link;stack->count--;returndata;}voidDestroyStack(Stack*stack){nodeS*node;if(stack->count==0)return;while(stack->cou

7、nt==0){deletestack->top->data;node=stack->top;stack->top=node->link;stack->count--;}deletestack;}Que*CreateQueue(){Que*queue;queue=newQue;if(queue==NULL)returnNULL;queue->count=0;queue->front=NULL;queue->rear=NULL;returnqueue;}voidEnqueue(Que*queue){nodeQ*node;

8、node=newnodeQ;if(node==NULL

9、

10、queue==NULL)return;node->next=NULL;if(queue->count==0){queue->front=node;}else{queue->rear->next=node;}queue->rear=node;queue->count++;}void*Dequeue(Que*queue){void*dataptr;if(queue->count==0)returnNULL;dataptr=queue->front->dataptr

11、;if(queue->count==1)queue->front=queue->rear=NULL;elsequeue->front=queue->front->next;queue->count--;returndataptr;}voidDestroyqueue(Que*queue){nodeQ*node;if(queue->count==0)return;while(queue->count==0){deletequeue->front->dataptr;node=queue->front;queue->fron

12、t=node->next;queue->count--;}deletequeue;}3.主文件ThePort.cpp#include"Car.h"#include#include#includetypedefstructInFor{stringnum;inthour;intmin;intsec;i

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。