Aktualizovat „du6/program.c“

This commit is contained in:
Bohdan Yanchyk 2020-04-16 10:20:24 +00:00
parent f0baf5e69b
commit a27af28f34

View File

@ -26,19 +26,12 @@ int main()
} }
int pm = 0; int pm = 0;
char** pole_smernikov = malloc(fullSIZE * sizeof(char)); char** pole_smernikov = malloc(fullSIZE * sizeof(char));
//char* success[SIZE];
//char* unsuccess[SIZE];
//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);
//char* r;
//int q = 0;
size_t pocet_znakov = 0; size_t pocet_znakov = 0;
int antiInfC = 0; int antiInfC = 0;
char r = 'a'; char r = 'a';
while (fgets(line,wSIZE,stdin)) { while (fgets(line,wSIZE,stdin)) {
k = 0; k = 0;
pocet_znakov = strlen(line); pocet_znakov = strlen(line);
char* all = malloc(pocet_znakov); char* all = malloc(pocet_znakov);
@ -47,7 +40,6 @@ int main()
if(memcmp(pole_smernikov[x], line, pocet_znakov) == 0){ if(memcmp(pole_smernikov[x], line, pocet_znakov) == 0){
k++; k++;
} }
//pole_smernikov[k] = line;
} }
if(0 == k){ if(0 == k){
pole_smernikov[pm] = all; pole_smernikov[pm] = all;
@ -74,18 +66,8 @@ int main()
pole_smernikov[j-1] = temp; pole_smernikov[j-1] = temp;
} }
} }
// if (memcmp(pole_smernikov[i],line,pocet_znakov)){
// // Nasiel som
// unsuccess[k] = pole_smernikov[i];
// printf("%s\n", unsuccess[k]);
// } else{
// success[q] = pole_smernikov[i];
// printf("%s\n", success[q]);
// }
i++; i++;
} }
// printf("%s\n", pole_smernikov[0]);
if(NULL == pole_smernikov[1]){ if(NULL == pole_smernikov[1]){
puts("Ziadne prihlasky"); puts("Ziadne prihlasky");
return 0; return 0;