Skip to content

Conversation

@Gadjib
Copy link
Owner

@Gadjib Gadjib commented Nov 1, 2023

No description provided.

Task 4-1/4-1.c Outdated
#include <stdio.h>
#include <math.h>
#include <stdbool.h>
#define sizeOfNumbers 20

Choose a reason for hiding this comment

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

Константы через define обычно объявляются КАПСОМ_С_ПОДЧЁРКИВАНИЕМ

Task 4-1/4-1.c Outdated
Comment on lines 33 to 42
int inverter = 0;
int multiplier = 1;
int increment = 0;

if (numberArray[0] == 1)
{
inverter = 1;
multiplier = -1;
increment = 1;
}

Choose a reason for hiding this comment

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

Не, это всё не нужно. Хотелось конверсии настоящего 32-битного (точнее, sizeof(int)) инта в массив бит, и обратно, там ничего специального со знаком делать не надо. У Вас какие-то непонятные 20-битные числа.

Task 4-1/4-1.c Outdated

int main()
{
int number1, number2;

Choose a reason for hiding this comment

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

Неинициализированные переменные запрещены стайлгайдом, и их не надо объявлять раньше времени

Task 4-1/4-1.c Outdated
Comment on lines 85 to 87
int number1Array[sizeOfNumbers];
int number2Array[sizeOfNumbers];

Choose a reason for hiding this comment

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

Массивы тоже надо инициализировать

Task 4-1/4-1.c Outdated
Comment on lines 110 to 111
int decSum;
decSum = binToDec(sumArray);

Choose a reason for hiding this comment

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

Suggested change
int decSum;
decSum = binToDec(sumArray);
int decSum = binToDec(sumArray);

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