I'm having this problem on ide Xcode. In line 8 the warning
Thread1: EXC_BAD_ACCESS (code = 1, address = 0x68)
The .txt file is in the same folder where main
is.
void construir1(struct elemento **P_inicio){
FILE *arq;
struct elemento *p1;
char c;
arq=fopen("t1.txt", "r");
*P_inicio = NULL;
while ((c= getc(arq))!=EOF) {
if (c!='\n') {
p1 = malloc(sizeof(struct elemento));
p1->x = c;
p1->prox = *P_inicio;
*P_inicio= p1;
}
}
fclose(arq);
return;
};