When I do not open the file(180mb) I get no error, but when I open the file I get a Segmentation fault 11. I am fairly certain that I am exceeding memory for the process. Anyone have any tips?
I have changed parameters. So if NUM_TRAIN = 10 instead of 60000, I do not get a segmentation fault. When NUM_TRAIN = 60000, but I do not open the file, I also do not get a segmentation fault. When NUM_TRAIN = 60000 and I open the file, I get a segmentation fault.
#include <stdio.h>
#define NUM_TRAIN 60000
#define IMAGE_SIZE 784
#define TRAIN_IMAGES "mnist_train.csv"
int main()
{
int arr[NUM_TRAIN][IMAGE_SIZE];
int arr2[NUM_TRAIN];
FILE* fTrain = fopen(TRAIN_IMAGES, "r");
return 0;
}
I do not expect to get a segmentation fault but I am, specifically a Segmentation fault 11