Initialization
This commit is contained in:
		
							parent
							
								
									abbbb56cf0
								
							
						
					
					
						commit
						275e0c10d1
					
				| @ -42,18 +42,8 @@ int main() { | |||||||
|         } |         } | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     if (i!= count) { |  | ||||||
|         printf("Nespravny vstup\n"); |  | ||||||
|         for (j = 0; j < i; j++) { |  | ||||||
|             free(applications[j]); |  | ||||||
|         } |  | ||||||
|         free(applications); |  | ||||||
|         return 1; |  | ||||||
|     } |  | ||||||
| 
 |  | ||||||
|     if (i == 0) { |     if (i == 0) { | ||||||
|         printf("Ziadne prihlasky\n"); |         printf("Ziadne prihlasky\n"); | ||||||
|         free(applications); |  | ||||||
|         return 1; |         return 1; | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
| @ -61,10 +51,17 @@ int main() { | |||||||
|     qsort(applications, i, sizeof(char *), compare_names); |     qsort(applications, i, sizeof(char *), compare_names); | ||||||
| 
 | 
 | ||||||
|     printf("Prijati studenti:"); |     printf("Prijati studenti:"); | ||||||
|     for (j = 0; j < i; j++) { |     for (j = 0; j < i; ++j) { | ||||||
|         printf("%s\n", applications[j]); |         printf("%s\n", applications[j]); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  |     if (count < i) { | ||||||
|  |         printf("Neprijati studenti:"); | ||||||
|  |         for (; j < i; j++) { | ||||||
|  |             printf("%s\n", applications[j]); | ||||||
|  |         } | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|     // Free allocated memory
 |     // Free allocated memory
 | ||||||
|     for (j = 0; j < i; j++) { |     for (j = 0; j < i; j++) { | ||||||
|         free(applications[j]); |         free(applications[j]); | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user