Skip to content

Conversation

@kamendov-maxim
Copy link
Owner

No description provided.

}
size_t strl = stack->length * 2;
addToString(stack->head, output, strl - 2);
output[strl -1 ]= '\0';

Choose a reason for hiding this comment

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

поправить пробелы

output[strl -1 ]= '\0';
return output;
}

Choose a reason for hiding this comment

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

лишний перенос

return NULL;
}
size_t strl = stack->length * 2;
addToString(stack->head, output, strl - 2);

Choose a reason for hiding this comment

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

переделать на цикл

Copy link
Owner Author

Choose a reason for hiding this comment

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

через указатели на предыдущие элементы?

Choose a reason for hiding this comment

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

по стеку идём вперёд, по строке назад


// получить строку со всеми значениями стека, где самый правый элемент - самый верхний элемент стека
char *createString(Stack const *const stack, StackErrorCode *errorCode);

Choose a reason for hiding this comment

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

лишний перенос

char topElement(Stack const *const stack, StackErrorCode *const errorCode);

// получить строку со всеми значениями стека, где самый правый элемент - самый верхний элемент стека
char *createString(Stack const *const stack, StackErrorCode *errorCode);

Choose a reason for hiding this comment

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

const

#include <stdio.h>

// получить строку из *file до разделителя endOfLine
char *getString(FILE * file, char const endOfLine);

Choose a reason for hiding this comment

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

* const

while (ec != emptyStack && top != '(' && comparison != -1)
{
char operatorFromStack = getElement(operatorsStack, &ec);
ec = addElement(outputStack, operatorFromStack);

Choose a reason for hiding this comment

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

проверить код ошибки

}
}
ec = moveToOutputStack(outputStack, operatorsStack);
char *output = createString(outputStack, &ec);

Choose a reason for hiding this comment

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

удалить оба стека

@kamendov-maxim
Copy link
Owner Author

kamendov-maxim commented Dec 27, 2023

Разве для переделки рекурсии на цикл не придется излишне усложнить стек?
Или я не понимаю, как правильно сделать цикл

return NULL;
}
size_t strl = stack->length * 2;
addToString(stack->head, output, strl - 2);

Choose a reason for hiding this comment

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

по стеку идём вперёд, по строке назад

output[i + 1] = ' ';
}

char *createString(Stack const *const stack, StackErrorCode *errorCode)

Choose a reason for hiding this comment

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

const

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.

3 participants