I'm playing around with file pointers in preparation for the Recover Problem. I'm trying to understand something here. I can't actually open up the raw file to read on my IDE. And neither can I read it to make sense character-by-character as I tried in the code here.
Why does the following code print a bunch of gibberish and funky characters when I run it?
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
char ch;
FILE* stream = fopen("card.raw", "r");
if(stream != NULL)
{
for (int i = 0; i < 100000; i++)
{
ch = fgetc(stream);
printf("%c", ch);
}
}
fclose(stream);
}