So I tried to open and read a file this way but I get:
Thread 1: EXC_BAD_ACCESS (code=1, address=0x68) it says that the pointer is null
This is my code:
#include <stdio.h>
#include <stdlib.h>
int main(int argc, const char * argv[]) {
FILE * fp;
fp = fopen("labb.txt", "r");
char line[200];
while(!feof(fp)){
fgets(line, 200, fp);
puts(line);
}fclose(fp);
return 0;
}