Im trying to scan in a txt file with a string of numbers.
t.txt
123
223
323
File *f = fopen(t.txt, r)
while (i != 3){
for (int j = 0; j < 3; j++){
fscanf(f, %1c, &grid[i][j]);
}
i++;
}
But it prints a segment fault.
Tips, Expertise, Articles and Advice from the Pro's for Your Website or Blog to Succeed
Im trying to scan in a txt file with a string of numbers.
t.txt
123
223
323
File *f = fopen(t.txt, r)
while (i != 3){
for (int j = 0; j < 3; j++){
fscanf(f, %1c, &grid[i][j]);
}
i++;
}
But it prints a segment fault.