-
Notifications
You must be signed in to change notification settings - Fork 278
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
lab2 #897
base: master
Are you sure you want to change the base?
lab2 #897
Conversation
Рыбкина Анастасия Алексеевна Группа 3091
Не собирается. |
Всё ещё не собирается. |
Теперь не проходит тест. |
Всё ещё не проходит. |
Lab2CPP/lab2.cpp
Outdated
} | ||
|
||
if (!stack_empty(operators)) { | ||
if (stack_empty(operators)) { |
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.
Как здесь может сработать empty?
|
||
else if (example[i] == ')') { | ||
while (!stack_empty(operators) && stack_get(operators) != '(') { | ||
if (stack_empty(values)) throw std::runtime_error("Invalid expression"); |
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.
Тут empty никогда не сработает.
LibraryCPP/stack.h
Outdated
struct Stack; | ||
typedef struct Stack { | ||
Vector* vector; | ||
} Stack; |
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.
В заголовочный файл выносить определение структуры не нужно.
stack_pop(values); | ||
|
||
int val1 = stack_get(values); | ||
stack_pop(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.
Нужная проверка на пустоту тоже пропала вместе с ненужной.
LibraryCPP/vector.h
Outdated
// Vector (dynamic array) | ||
// Stores integer values inside | ||
typedef int Data; | ||
|
||
struct Vector; | ||
struct Vector { |
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.