void proc()
{
int i=0;
char str[52];
FILE *f;
predaj = fopen("subor.txt", "r");
char **udaje;
if ((udaje = malloc(30 * sizeof(char *))) == NULL){
printf("pamät fail");
exit(1);
}
while ((fgets(str, 52, f)) != NULL){
if ((udaje[i] = (char *)malloc(52)) == NULL){
printf("pamät fail 2");
exit(1);
}
strcpy(udaje[i], str);
i++;
}
for (i = 0; i < 30; i++)
free(udaje[i]);
free(udaje);
}
po zavolaní tejto procedury mi to hadze error
Unhandled exception at 0x6B19FB53 (msvcr120d.dll) in PRPR PROJEKT 1.exe: 0xC0000005: Access violation reading location 0xCDCDCDCD.
prosím vás je tam niekde chyba? dakujem.