Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (uslovie == true)
- {
- int number;
- char destination[10];
- char time[10];
- printf("Vvedite nomer: ");
- scanf_s("%d", &number);
- printf("n");
- printf("Vvedite punkt: ");
- gets_s(destination);
- printf("n");
- printf("Vvedite vremya: ");
- gets_s(time);
- printf("n");
- system("cls");
- push(&head, number, destination, time);
- printf("Element uspeshno dobavlen!n");
- system("pause");
- break;
- }
- else
- printf("Sozdaite spisok!n");
- system("pause");
- break;
- void push(avia **head, int number, char *destination, char *time)
- {
- avia *tmp = (avia*)malloc(sizeof(avia));
- if (*head == NULL)
- {
- tmp->number = number;
- for (int i = 0; i < 10; i++)
- tmp->destination[i] = destination[i];
- for (int i = 0; i < 10; i++)
- tmp->time[i] = time[i];
- tmp->next = NULL;
- *head = tmp;
- }
- else
- {
- tmp->number = number;
- for (int i = 0; i < 10; i++)
- tmp->destination[i] = destination[i];
- for (int i = 0; i < 10; i++)
- tmp->time[i] = time[i];
- tmp->next = *head;
- *head = tmp;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement