-
Couldn't load subscription status.
- Fork 0
Task2 #29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Task2 #29
Conversation
| // if (!test()) | ||
| // { | ||
| // printf("Программа не работает\n"); | ||
| // return PROGRAM_FAILED_TESTS; | ||
| // } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Закомментированный код не нужен
| Node *head; | ||
| } Queue; | ||
|
|
||
| Queue *createQueue(void){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| Queue *createQueue(void){ | |
| Queue *createQueue(void) | |
| { |
| return (Queue *)calloc(1, sizeof(Queue)); | ||
| } | ||
|
|
||
| ErrorCode enqueue(Queue * const queue,const int value, const size_t priority) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| ErrorCode enqueue(Queue * const queue,const int value, const size_t priority) | |
| ErrorCode enqueue(Queue * const queue, const int value, const size_t priority) |
| free(currentNode); | ||
| } | ||
| free(queue); | ||
| queue = NULL; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Оно так не работает. Надо было принимать queue как Queue**, иначе тут просто в локальный параметр запишется NULL, и вызывающий про это ничего не узнает
|
|
||
| typedef struct Queue Queue; | ||
|
|
||
| ErrorCode enqueue(Queue * const queue,const int value, const size_t priority); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Надо было комментарии к каждой функции в заголовочном файле
| } Command; | ||
|
|
||
| const bool testCase(Command const *const commands, size_t const *const priorities, | ||
| int const *const answers, const size_t testLen, const int * const values) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Тут надо отступ, потому что это продолжение предыдущей строки.
| const bool test(void) | ||
| { | ||
| return true; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Всё для тестов написали, а сами тесты — нет. Обидно :)
| #define PROGRAM_FAILED_TESTS 1 | ||
| #define MEMORY_ERROR 2 | ||
|
|
||
| int main(int, char **) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Оно так не умеет, надо имена параметров или убрать их вовсе
| Node *head; | ||
| } Queue; | ||
|
|
||
| Queue *createQueue(void){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
И что-то её в хедер не вынесли
No description provided.