Skip to content
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

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
Open

lab2 #897

wants to merge 17 commits into from

Conversation

ms-anastasiia
Copy link

No description provided.

@Dovgalyuk
Copy link
Owner

Не собирается.

@Dovgalyuk
Copy link
Owner

Всё ещё не собирается.

@Dovgalyuk
Copy link
Owner

Теперь не проходит тест.

@Dovgalyuk
Copy link
Owner

Всё ещё не проходит.

Lab2CPP/lab2.cpp Outdated
}

if (!stack_empty(operators)) {
if (stack_empty(operators)) {
Copy link
Owner

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");
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Тут empty никогда не сработает.

struct Stack;
typedef struct Stack {
Vector* vector;
} Stack;
Copy link
Owner

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);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Нужная проверка на пустоту тоже пропала вместе с ненужной.

// Vector (dynamic array)
// Stores integer values inside
typedef int Data;

struct Vector;
struct Vector {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Этого не должно быть в заголовочном файле.

@Dovgalyuk
Copy link
Owner

Определение вектора размножилось. И ненужные проверки появились.

@Dovgalyuk
Copy link
Owner

Несколько лишних проверок, о которых я раньше говорил, осталось.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants