Skip to content

start#1

Open
Golem24434 wants to merge 14 commits into
mainfrom
other
Open

start#1
Golem24434 wants to merge 14 commits into
mainfrom
other

Conversation

@Golem24434

Copy link
Copy Markdown
Owner

No description provided.

@DPeshkoff DPeshkoff left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Привет!

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

Comment thread DZ1.c Outdated

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

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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

Comment thread 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
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Comment thread 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
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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

Comment thread 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
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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

Comment thread function.c Outdated
Comment thread function.c Outdated
return ArrayMuCo;
}

void output_info(MusComp *ArrayMuCo, int NumberInArray)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Comment thread function.c Outdated
}
}

void find_random_music_composition(MusComp *ArrayMuCo, int NumberInArray, int CountElement)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Comment thread 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
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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

Comment thread function.h Outdated
Comment thread 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
Copy Markdown
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
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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

Comment thread 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
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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

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

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

{}

Comment thread function.h
#include <stdio.h>
#include <malloc.h>
#include <string.h>
#include <stdlib.h>

Copy link
Copy Markdown
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