Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- FILE *file = fopen("pong.ch8", "rb");
- fclose(file);
- u8 *buffer = 0;
- long size;
- if(file)
- {
- fseek(file, 0, SEEK_SET);
- size = ftell(file);
- rewind(file);
- buffer = (u8 *)malloc(size);
- fread(buffer, 0, size, file);
- fclose(file);
- int count;
- //printf("test");
- printf("\n%ld", size);
- //for(count = 0; count < size; count++)
- // printf("%08x", buffer[count]);
- //printf("\nFile readback complete.");
- free(buffer);
- }
- else printf("File is null. Exiting...");
Add Comment
Please, Sign In to add comment