Open
Conversation
DPeshkoff
requested changes
Oct 13, 2021
Collaborator
DPeshkoff
left a comment
There was a problem hiding this comment.
Привет!
Отсутствуют тесты, отсутствует CI.
DZ1.c
Outdated
|
|
||
| int main() { | ||
| srand(time(NULL)); | ||
| MusComp *ArrayMuCo = (MusComp*)malloc(1*sizeof(MusComp)); |
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++) { |
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()!"); |
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); |
function.c
Outdated
| return ArrayMuCo; | ||
| } | ||
|
|
||
| void output_info(MusComp *ArrayMuCo, int NumberInArray) |
function.c
Outdated
| } | ||
| } | ||
|
|
||
| void find_random_music_composition(MusComp *ArrayMuCo, int NumberInArray, int CountElement) |
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 |
Collaborator
There was a problem hiding this comment.
Почему-то 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" |
Collaborator
There was a problem hiding this comment.
include'ы повторяются здесь и в .h файле, зачем?
malloc подключается и из <malloc.h>, и из <stdlib.h>
DPeshkoff
requested changes
Oct 14, 2021
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 |
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); |
Collaborator
There was a problem hiding this comment.
не исправлено, названия переменных тоже в snake_case
function.c
Outdated
| } | ||
| index++; | ||
| } | ||
| if (OutCount != CountElement + 1) printf("There are no more music tracks with such parameters."); |
| #include <stdio.h> | ||
| #include <malloc.h> | ||
| #include <string.h> | ||
| #include <stdlib.h> |
Collaborator
There was a problem hiding this comment.
malloc есть в stdlib.h и в malloc.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.