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

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

ID:50292388

大小:42.50 KB

页数:15页

时间:2020-03-07

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

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

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;nodeQ*rear;}Que;Stack*Creat

2、estack();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*Createstack(){Stack*stack;stack=newStack;if(stack==NULL)returnN

3、ULL;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++;}void*pop(Stack*stack){void*data;nodeS*node;node=newnodeS;if(stack->count==0)retu

6、rnNULL;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->count==0){deletestack->top->data;node=stack->top;stack->top=node->link;stack->count--;}deletestack;}Que*CreateQueue

7、(){Que*queue;queue=newQue;if(queue==NULL)returnNULL;queue->count=0;queue->front=NULL;queue->rear=NULL;returnqueue;}voidEnqueue(Que*queue){nodeQ*node;node=newnodeQ;if(node==NULL

8、

9、queue==NULL)return;node->next=NULL;if(queue->count==0){queue->front=node;}else{queue->rear->next=node;}queue->r

10、ear=node;queue->count++;}void*Dequeue(Que*queue){void*dataptr;if(queue->count==0)returnNULL;dataptr=queue->front->dataptr;if(queue->count==1)queue->front=queue->rear=NULL;elsequeue->front=queue->front->next;queue->count--;returndataptr;}voidDestroyqueue(Que*queue){nodeQ*node;if(queue->cou

11、nt==0)return;while(queue->count==0){deletequeue->front->dataptr;node=queue->front;queue->front=node->next;queue->count--;}deletequeue;}3.主文件ThePort.cpp#include"Car.h"#include#include#includetypedefstructInFor{stringnum;inthour;intmin;intsec;i

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

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

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