0
I am having this problem in ide Xcode. On line 8 the warning appears
Thread1: EXC_BAD_ACCESS (code=1,address=0x68)
The file . txt is in the same folder as the main
.
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;
};
I compiled the same code on Linux using gcc and it works perfectly. It really is something from Xcode or Mac, if any know what it can be and how to solve it would be of great help.
– NamelessBorneo