- Joined
- Jan 12, 2017
- Messages
- 277
- Reaction score
- 724
- Trophies
- 0
- Location
- United States
- XP
- 1,246
- Country

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?






