Skip to content

Comments

start#1

Open
Golem24434 wants to merge 14 commits intomainfrom
other
Open

start#1
Golem24434 wants to merge 14 commits intomainfrom
other

Conversation

@Golem24434
Copy link
Owner

No description provided.

Copy link
Collaborator

@DPeshkoff DPeshkoff left a comment

Choose a reason for hiding this comment

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

Привет!

Отсутствуют тесты, отсутствует CI.

DZ1.c Outdated

int main() {
srand(time(NULL));
MusComp *ArrayMuCo = (MusComp*)malloc(1*sizeof(MusComp));
Copy link
Collaborator

Choose a reason for hiding this comment

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

malloc не проверяется

DZ1.c Outdated
int NumberInArray, SizeArray = 1, inputCount;
FILE *fin = fopen("C:\\Users\\Omar\\Desktop\\Tehnopark_C_Cpp\\Second\\DataBase.txt", "r");
if (fin == NULL) printf("Error! File with data can't open!");
for (NumberInArray = 0;NumberInArray < 125;NumberInArray++) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

DZ1.c Outdated
FILE *fin = fopen("C:\\Users\\Omar\\Desktop\\Tehnopark_C_Cpp\\Second\\DataBase.txt", "r");
if (fin == NULL) printf("Error! File with data can't open!");
for (NumberInArray = 0;NumberInArray < 125;NumberInArray++) {
if (fgets(strin, MAX_SIZE_STRING, fin) == NULL) printf("Error with gets()!");
Copy link
Collaborator

Choose a reason for hiding this comment

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

Не пренебрегай {}

DZ1.c Outdated
Comment on lines 25 to 27
scanf("How many tracks do you want to see? %d",&inputCount);
find_random_music_composition(ArrayMuCo,NumberInArray,inputCount);
fclose(fin);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Что-то с отступами

function.c Outdated
return ArrayMuCo;
}

void output_info(MusComp *ArrayMuCo, int NumberInArray)
Copy link
Collaborator

Choose a reason for hiding this comment

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

function.c Outdated
}
}

void find_random_music_composition(MusComp *ArrayMuCo, int NumberInArray, int CountElement)
Copy link
Collaborator

Choose a reason for hiding this comment

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

function.c Outdated
Comment on lines 8 to 10
#define MAX_SIZE_NAME 30
#define MAX_SIZE_STRING 40
#define SIZE_NUMBER_IN_FILE 3
Copy link
Collaborator

Choose a reason for hiding this comment

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

Почему-то define и здесь, и в .h

function.c Outdated
Comment on lines 1 to 6
#include <stdio.h>
#include <malloc.h>
#include <string.h>
#include <stdlib.h>
#include <time.h>
#include "function.h"
Copy link
Collaborator

Choose a reason for hiding this comment

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

include'ы повторяются здесь и в .h файле, зачем?

malloc подключается и из <malloc.h>, и из <stdlib.h>

@Golem24434 Golem24434 requested a review from DPeshkoff October 14, 2021 10:17
Comment on lines +1 to +15
{
"configurations": [
{
"name": "Win32",
"includePath": [
"${default}"
],
"compilerPath": "C:/Program Files/mingw-w64/x86_64-8.1.0-posix-seh-rt_v6-rev0/mingw64/bin/gcc.exe",
"cStandard": "c17",
"cppStandard": "c++17",
"intelliSenseMode": "linux-gcc-x64"
}
],
"version": 4
} No newline at end of file
Copy link
Collaborator

Choose a reason for hiding this comment

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

Зачем здесь этот файл?

DZ1.c Outdated
for (NumberInArray = 0;NumberInArray < 125;NumberInArray++) {
if (fgets(strin, MAX_SIZE_STRING, fin) == NULL) printf("Error with gets()!");
ElementMuCo = create_struct_music_composition(strin, fin);
ArrayMuCo = add_in_array(ArrayMuCo, &SizeArray, &NumberInArray, ElementMuCo);
Copy link
Collaborator

Choose a reason for hiding this comment

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

не исправлено, названия переменных тоже в snake_case

function.c Outdated
}
index++;
}
if (OutCount != CountElement + 1) printf("There are no more music tracks with such parameters.");
Copy link
Collaborator

Choose a reason for hiding this comment

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

{}

#include <stdio.h>
#include <malloc.h>
#include <string.h>
#include <stdlib.h>
Copy link
Collaborator

Choose a reason for hiding this comment

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

malloc есть в stdlib.h и в malloc.h

@Golem24434 Golem24434 requested review from DPeshkoff and Vinograduss and removed request for Vinograduss October 14, 2021 12:52
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