Open
Conversation
WoWaster
requested changes
Nov 14, 2025
Merge stack branch into sorted station branch
WoWaster
requested changes
Dec 6, 2025
Collaborator
WoWaster
left a comment
There was a problem hiding this comment.
Я правда обнаружил, что у Вас нет ветки со стеком, но уже деваться некуда :(
|
|
||
| deleteStack(stack); | ||
| // чтобы строка была корректной | ||
| queue[queueEndPtr] = '\0'; |
Collaborator
There was a problem hiding this comment.
Хорошо бы ещё realloc здесь сделать
src/SortingStation/sortingStation.c
Outdated
Comment on lines
93
to
99
| int queueLength = strlen(queue); | ||
| for (unsigned i = 0; i <= queueLength; i++) { | ||
| printf("%c", queue[i]); | ||
| if (i == strlen(queue)) { | ||
| printf("\n"); | ||
| } | ||
| } |
Collaborator
There was a problem hiding this comment.
А почему нельзя просто
Suggested change
| int queueLength = strlen(queue); | |
| for (unsigned i = 0; i <= queueLength; i++) { | |
| printf("%c", queue[i]); | |
| if (i == strlen(queue)) { | |
| printf("\n"); | |
| } | |
| } | |
| printf("%s\n", queue); |
?
| char* convertString(char* string, int len) | ||
| { | ||
| struct Stack* stack = newStack(); | ||
| char* queue = malloc(1000 * sizeof(char)); |
src/SortingStation/sortingStation.c
Outdated
| return 0; | ||
| } | ||
|
|
||
| char* convertString(char* string, int len) |
Collaborator
There was a problem hiding this comment.
А почему длину строки нельзя посчитать прямо внутри функции?
WoWaster
approved these changes
Dec 9, 2025
| queue[queueEndPtr] = '\0'; | ||
| char* queue_realloced = realloc(queue, sizeof(char) * (strlen(queue) + 1)); | ||
| free(stack); | ||
| return queue_realloced; |
Collaborator
There was a problem hiding this comment.
Давайте я сделаю вид, что я не видел, что Вы накосячили с неймингом.
Owner
Author
There was a problem hiding this comment.
господи, простите.... Чего-то я с питона не переключилась...
Collaborator
There was a problem hiding this comment.
Тут всё ещё что-то странно с английским языком, но пусть это будет Вашей проблемой, а не моей.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Добавила файл к домашней работе "Сортировочная станция". Здесь три файла:
файл с решением задачи
файл с реализацией стека
файл с объявлениями структур и функций стека
последние два файла изначально были созданы на ветке стека.
P.S. Это еще одна, другая, ветка, исходящая от ветки стека.