So I'm trying to read a 4MB (4,000,000 bytes) binary file into a struct like so
but no matter what I do it just crashes on everything?
Code:
typedef struct boardData {
unsigned char board[1024*1024*4];
} board;
int main(int argc, char **argv) {
gfxInitDefault();
consoleInit(GFX_TOP, NULL);
struct boardData board;
FILE *fpr = fopen("romfs:/boarddata", "r");
if(fpr != NULL)
{
printf(":O");
fread(&board, 1, 2000, fpr);
fclose(fpr);
}
but no matter what I do it just crashes on everything?