user-0 提问: C语言 一个简单的停车场管理程序，有2 个错 求助，急！

回复:
user: user-1
content: 引用 14 楼 runawaysmile 的回复:谢谢！刚开始混论坛~\(≧▽≦)/~没事，慢慢学习！

user: user-0
content: 谢谢！刚开始混论坛~\(≧▽≦)/~

user: user-1
content: 引用 12 楼 runawaysmile 的回复:话说，怎么结贴来着？？在你描述的问题的上方，你的标题上面有深蓝色的按钮，第二个就是结贴。

user: user-0
content: 话说，怎么结贴来着？？

user: user-1
content: 装不上vs就试一下codeblocks，也不大。把flushall()改成getchar()，看看行不行。

user: user-1
content: 你试一下在flushall()的地方换成getchar();

user: user-0
content: 我的电脑安不上VS 不知道为什么。。

user: user-0
content: 删除掉以后可以运行了，但是好奇怪啊，是这样的  我的天，有好多地方出现了无限循环

user: user-0
content: 我用的是C-FREE。

user: user-0
content: 可以了，运行结果好奇怪。。我再看看

user: user-1
content: 楼主的程序错误很多啊，你的代码也没有注释，我就改成可以运行了而已。 #include<stdio.h> #include<stdlib.h> #include<string.h> #define MAX 2 #define price 0.05  typedef struct time { 	int hour; 	int min; } Time;  typedef struct node { 	char num[10]; 	Time reach; 	Time leave; } CarNode;  typedef struct NODE { 	CarNode *stack[MAX + 1]; 	int top; } SeqStackCar;  typedef struct car { 	CarNode *data; 	struct car *next; } QueueNode;  typedef struct Node { 	QueueNode *head; 	QueueNode *rear; } LinkQueueCar;  void InitStack(SeqStackCar *); int InitQueue(LinkQueueCar *); int Arrival(SeqStackCar *, LinkQueueCar *); void Leave(SeqStackCar *, SeqStackCar *, LinkQueueCar *); void List(SeqStackCar, LinkQueueCar);  void main() { 	SeqStackCar Enter, Temp; 	LinkQueueCar Wait; 	int ch; 	InitStack(&Enter); 	InitStack(&Temp); 	InitQueue(&Wait); 	while (1) 	{ 		printf("\n1.arrival"); 		printf("2.departure"); 		printf("3.show"); 		printf("4.exit\n"); 		while (1) 		{ 			scanf("%d", &ch); 			if (ch >= 1 && ch <= 4)break; 			else printf("\n please choose a number"); 		} 		switch (ch) 		{ 		case 1: 			Arrival(&Enter, &Wait); break; 		case 2: 			Leave(&Enter, &Temp, &Wait); 			break; 		case 3: 			List(Enter, Wait); 			break; 		case 4: 			exit(0); 		default: 			break; 		} 	} }  void InitStack(SeqStackCar *s) { 	int i; 	s->top = 0; 	for (i = 0; i <= MAX; i++) 		s->stack[s->top] = NULL; }  int InitQueue(LinkQueueCar *Q) { 	Q->head = (QueueNode *)malloc(sizeof(QueueNode)); 	if (Q->head != NULL) 	{ 		Q->head->next = NULL; 		Q->rear = Q->head; 		return(1); 	} 	else return(-1); }  void PRINT(CarNode *p, int room) { 	int A1, A2, B1, B2; 	printf("\n please input time of departure:/**:**/"); 	scanf("%d:%d", &(p->leave.hour), &(p->leave.min)); 	printf("\n the number of car is :"); 	puts(p->num); 	printf("\n its time of arrival is :%d:%d", p->reach.hour, p->reach.min); 	printf("time of departure is :%d:%d", p->leave.hour, p->leave.min); 	A1 = p->reach.hour; 	A2 = p->reach.min; 	B1 = p->leave.hour; 	B2 = p->leave.min; 	printf("\n the fee is : %2.1 f dollar", ((B1 - A1) * 60 + (B2 - A2))*price); 	free(p); }  int Arrival(SeqStackCar *Enter, LinkQueueCar *W) { 	CarNode *p; 	QueueNode *t; 	p = (CarNode *)malloc(sizeof(CarNode)); 	flushall(); 	printf("\n please input the number of car :"); 	gets(p->num); 	if (Enter->top<MAX) 	{ 		Enter->top++; 		printf("\n the car is at %d.", Enter->top); 		printf("\n please input the time of arrival:/**:**/"); 			scanf("%d:%d", &(p->reach.hour), &(p->reach.min)); 		Enter->stack[Enter->top] = p; 		return (1); 	} 	else 	{ 		printf("\n it has to wait!"); 			t = (QueueNode *)malloc(sizeof(QueueNode)); 		t->data = p; 		t->next = NULL; 		W->rear->next = t; 		W->rear = t; 		return(1); 	} }  void Leave(SeqStackCar *Enter, SeqStackCar *Temp, LinkQueueCar *W) { 	int i, room; 	CarNode *p, *t; 	QueueNode *q; 	if (Enter->top>0) 	{ 		while (1) 		{ 			printf("\n please input the position of car /1--%d/:,Enter->top"); 				scanf("%d", &room); 			if (room >= 1 && room <= Enter->top) break; 		} 		while (Enter->top>room){ 			Temp->top++; 			Temp->stack[Temp->top] = Enter->stack[Enter->top]; 			Enter->stack[Enter->top] = NULL; 			Enter->top--; 		} 		p = Enter->stack[Enter->top]; 		Enter->stack[Enter->top] = NULL; 		Enter->top--; 		while (Temp->top >= 1) 		{ 			Enter->top++; 			Enter->stack[Enter->top] = Temp->stack[Temp->top]; 			Temp->stack[Temp->top] = NULL; 			Temp->top--; 		} 		PRINT(p, room); 		if ((W->head != W->rear) && Enter->top<MAX) 		{ 			q = W->head->next; 			t = q->data; 			Enter->top++; 			printf("\n car number %s gets into the %d position.", t->num, Enter->top); 			printf("\n please input time right now:/**:**/:"); 			scanf("%d:%d", &(t->reach.hour), &(t->reach.min)); 			W->head->next = q->next; 			if (q == W->rear) 				W->rear = W->head; 			Enter->stack[Enter->top] = t; 			free(q); 		} 		else printf("\n there is no car on the way !~\n"); 	} 	else printf("\n there is no car in the carpark."); }  void List1(SeqStackCar *S) { 	int i; 	if (S->top>0) 	{ 		printf("\n carpark:"); 		printf("\n position /time of arrival/ number\n"); 		for (i = 1; i <= S->top; i++) 		{ 			printf("%d",i); 				printf("%d:%d",S->stack[i]->reach.hour,S->stack[i]->reach.min); 				puts(S->stack[i]->num); 		} 	} 	else printf("\n there is no car in the carpark"); }  void List2(LinkQueueCar *W) { 	QueueNode *p; 	p = W->head->next; 	if (W->head != W->rear) 	{ 		printf("\n the number of car which is waiting is :"); 		while (p != NULL) 		{ 			puts(p->data->num); 			p = p->next; 		} 	} 	else printf("\n there is no car in the way."); }  void List(SeqStackCar S, LinkQueueCar W) { 	int flag, tag; 	flag = 1; 	while (flag) 	{ 		printf("\n plese choose 1 \2\3:"); 		printf("\n 1.carpark \n 2. way 3. return \n"); 		while (1) 		{ 			scanf("%d", &tag); 			if (tag >= 1 || tag <= 3) break; 			else 				printf("\n please choose 1/2/3:"); 		} 		switch (tag) 		{ 		case 1:List(S,W); break; 		case 2:List(S,W); break; 		case 3:flag = 0; break; 		default:break; 		} 	} }

user: user-1
content: 124行：flushall();不行就删掉，我看没有什么影响。

user: user-1
content: 引用 3 楼 runawaysmile 的回复:第124行错误 implicit declaration of function 怎么修改。。就只有这一个错了额你使用什么开发环境？我是在vs2013上运行的，在C-Free上面也报错，但是用法应该没有错，暂时没有在网上找到解决方案。

user: user-0
content: 第124行错误 implicit declaration of function 怎么修改。。就只有这一个错了额

user: user-0
content: 额，谢谢，不知道为什么会有这么多错啊，我之前只改了一点点然后就出现了很多错。。OTL