I can't find why it's giving me a segmentation fault errorCode:#include<stdio.h> #include<stdlib.h> int main() { FILE *ofp; ofp = fopen("Cards.dat", "r"); if (ofp == NULL) { printf("Unable to open Cards.dat"); } int numbers[10][2]; int r, c, n; for (r = 0; r < 100; ++r) { for(c = 0; c < 2; ++c) { fscanf(ofp, "%d", &n); numbers[r][c] = n; } } printf("%d\n", numbers[0][0]); return 0; }
Here's the file it's pulling from...
Code:1 4 11 3 4 2 0 0