Conversation
yurii-litvinov
left a comment
There was a problem hiding this comment.
Я так и не понял, зачем тут стек и почему вместо него нельзя было завести массив из strlen(itoa(INT_MAX)) элементов :)
| #include <string.h> | ||
|
|
||
| int returnFirstSymbolInNumber(int* number, int sizeNumber) { | ||
| int divide = pow(10, sizeNumber - 1); |
There was a problem hiding this comment.
Отступы табуляциями, а надо пробелами :)
| #include <stdbool.h> | ||
| #include <string.h> | ||
|
|
||
| int returnFirstSymbolInNumber(int* number, int sizeNumber) { |
There was a problem hiding this comment.
Неудачное название. Она не только возвращает первую цифру, но и удаляет её из числа
| workWithFile(&errorCheck, fileName, numberString); | ||
| switch (errorCheck) | ||
| { | ||
| case(ok): |
There was a problem hiding this comment.
Тут скобки не нужны,
| case(ok): | |
| case ok: |
| emptyPointer, | ||
| anotherError, | ||
| ok, | ||
| }Error; |
There was a problem hiding this comment.
| }Error; | |
| } Error; |
| ok, | ||
| }Error; | ||
|
|
||
| Stack* createStack(Error* errorCheck); |
There was a problem hiding this comment.
Надо комментарии, к каждой функции в заголовочном файле
|
|
||
| int createNumberFromStack(Stack* stack, Error* errorCheck); | ||
|
|
||
| void addElementsFromStringToStack(Stack* stack, Error* errorCheck, char value); |
There was a problem hiding this comment.
Странное название для функции, принимающей символ --- строки, о которой идёт речь в названии, вроде как нет.
| return -1; | ||
| } | ||
|
|
||
| Stack* stack = createStack(errorCheck); |
There was a problem hiding this comment.
Зачем стек, это была первая задача, на материал первых трёх пар семестра :)
| int multiplay = 1; | ||
|
|
||
| while (walker != NULL) { | ||
| number += ((int)walker->value - 48)* multiplay; |
There was a problem hiding this comment.
| number += ((int)walker->value - 48)* multiplay; | |
| number += (walker->value - '0') * multiplay; |
| temp->next = stack->head; | ||
|
|
||
| stack->head = temp; | ||
| return; |
No description provided.