Aktualizovat „du6/program.c“

This commit is contained in:
Bohdan Yanchyk 2020-04-16 07:48:26 +00:00
parent 6366290c7c
commit 8b288fa260

View File

@ -31,11 +31,12 @@ int main()
//memset(pole_smernikov,0,SIZE*sizeof(char*)); //memset(pole_smernikov,0,SIZE*sizeof(char*));
int k = 0; int k = 0;
char* line = malloc(wSIZE * sizeof(char)); char* line = malloc(wSIZE * sizeof(char));
memset(line,0,SIZE); //memset(line,0,SIZE);
//char* r; //char* r;
//int q = 0; //int q = 0;
int pocet_znakov = 0; size_t pocet_znakov = 0;
while (fgets(line,SIZE,stdin)) { while (fgets(line,wSIZE,stdin)) {
k = 0;
pocet_znakov = strlen(line); pocet_znakov = strlen(line);
char* all = malloc(pocet_znakov); char* all = malloc(pocet_znakov);
memcpy(all, line, pocet_znakov); memcpy(all, line, pocet_znakov);
@ -50,6 +51,7 @@ int main()
pm++; pm++;
} }
} }
free(line);
k = 0; k = 0;
int i = 0; int i = 0;
i = 0; i = 0;