Compare commits
No commits in common. "2314d074b49da55df5df1fe2c98172e5366f0766" and "4fde774336c7639463c880c32d50f622a352e782" have entirely different histories.
2314d074b4
...
4fde774336
@ -4,11 +4,13 @@
|
||||
#include <string.h>
|
||||
|
||||
|
||||
int main(void){
|
||||
/*int main(void){
|
||||
printf("Zadajte zoznam cieľových staníc a počet cestujúcich.\n");
|
||||
printf("Zoznam zakončite prázdnym riadkom.\n");
|
||||
|
||||
add_car;
|
||||
return 0;
|
||||
}
|
||||
}*/
|
||||
|
||||
struct car* add_car(struct car* first,const char* target) {
|
||||
struct car* newcar = calloc(1,sizeof(struct car));
|
||||
@ -34,15 +36,15 @@ void print_train(struct car* first) {
|
||||
|
||||
void cancel_train(struct car* first) {
|
||||
if(first!=NULL){
|
||||
struct car* temp=first;
|
||||
struct car* next;
|
||||
while(temp!=NULL){
|
||||
next=temp->next;
|
||||
free(temp);
|
||||
temp=next;
|
||||
}
|
||||
struct car* temp= first;
|
||||
struct car* next;
|
||||
while(temp!=NULL){
|
||||
next=temp->next;
|
||||
free(temp);
|
||||
temp=next;
|
||||
}
|
||||
first=NULL;
|
||||
}
|
||||
}
|
||||
|
||||
//Funkcia na zrušenie spojkového zoznamu môže pracovať rekurzívne:
|
||||
|
BIN
cv5/train.exe
BIN
cv5/train.exe
Binary file not shown.
Loading…
Reference in New Issue
Block a user