I get how to solve it. I have the pseudocode in mind on how to solve it. But i cannot understand how do I go about solving it though because I cannot address the most fundamental problem. How do I go about reading the file from the start to the very end
so far I only understood how to read the file to find the start of the jpeg. However I don't really understand how I should proceed from here to keep moving.
FILE* card = fopen("card.raw", "r");
if(card == NULL)
{
printf("did not open card.raw");
return 1;
}
int* buffer = malloc(sizeof(int) * 1024);
fread(buffer, 512, 1, card);
for(int c = 0; c != EOF; c++)
{
if(c > 3)
{
if(buffer[c - 3] == 0xff)
{
if(buffer[c - 2] == 0xd8)
{
if(buffer[c - 1] == 0xff)
{
if(buffer[c] == 0xe1)
{
printf("found one");
}
}
}
}
}
}