CS50 Recover - Week 4 - Recover Solution 2024. (Beginners Guide) - Week 4 Problem Set

preview_player
Показать описание
Welcome to This is CS50 Week 4 Problem Set - Recover. This tutorial will cover how to complete CS50x Population
Рекомендации по теме
Комментарии
Автор

I can't thank you enough for this. I had the general pseudocode figured out, but I'm still confused with how to work with files and pointers, and your explanation was the best I could find. I just hope you'll be able to upgrade your mic at some point, as the voice is mixed pretty quiet but some of the "p" sounds are overwhelming. Also it's be great if you could zoom a bit more on your screen, as it's sometimes hard to read. The content was top notch though !

ruskasielu
Автор

How did they even try to give us this problem set without me having even the SLIGHTEST IDEA of how to start.

thecozyplace
Автор

Alright I got stuck on this for about 18 hours as I tried this using malloc and kept getting segmentation faults. After running Debug50 I found that my code was not even entering the while loop at all. After removing the pointers and "&" stuff I was trying and tweaking some logic using a similar apprach to you, I managed to get it sorted! Thanks mate.

Braithwaite_Codes
Автор

Can you explain how the (buffer[3] & 0xf0) == 0xe0 conditional works? It is a new format for me. Does it like loop through all number from 0xf0 to 0xe0 or?

AdityaWilson
Автор

Thank you for this! This one is kicking my a**! It made me cry and I said i was giving up probably 3 times this week hahahah! Are those telescopes behind you in the corner? I have several telescopes and different equipment. Wondered if you had astrophotography videos

jhk
Автор

what's the actual value of found jpg after the loop? True or False? I kind of got lost where outptr was null but then it changed and you used it in another stuff

venlociraptor
Автор

Can u explain the bool here? When is it false when true in if conditions?

zeynabgol
Автор

Hey, I love all your videos and the way you explain things. I would love to join your discord to learn more, is there a way I could join? Thank you for all the hard work and keep it up!!!

roryloud
Автор

could you do one for reverse too, please?

sehrlimagic
Автор

can you explain further, if (buffer[0] == 0xff && buffer[1] == 0xd8 && buffer[2] == 0xff && (buffer[3] & 0xf0) == 0xe0) that mean you have found the beginning of JPEG, why we have inner if ? ... its confused me

Another_me
Автор

your code in video is not visible that much so please improve the quality or maybe changing this theme can solve this issue .

radheradhe
Автор

I'm having trouble where I keep getting an error saying the 001.jpg file not found. None of the test cases recovering the images are passing

pranavrajesh
Автор

Hi! I keep getting this error message : :( recovers 000.jpg correctly, :( recovers 049.jpg correctly, :( recovers middle images correctly, :| program is free of memory errors. I am very confused. Thank you so so much!

rebeccascognamiglio
Автор

Before creating my code, I just wanted to print out the 2048 blocks to see if I could find those beginning hex sequences if one found was 0xff. I created a buffer to read data into and then printed them out but never found the 0xff 0xd8 0xff 0xe_ sequence. Can anyone explain this?

uint8_t buffer[2048];

fread(buffer, 1, 2048, card);
if (card == NULL)
{
return 1;
}

for (int i = 0; i < 2048; i++)
{
if (buffer[i] == 0xff)
{
printf("%x %x %x\n", buffer[i + 1], buffer[i + 2], buffer[i + 3]);
}
}

zDoubleE
Автор

When I try to compile it just tells me that recover is a directory. What do I do cause I have this same problem with mario.

tigerlilywilliams
Автор

i could not figure out what is what i was doing wrong in my program.. now i see i was overcomplicating things

jamiroquaiordie
Автор

is there a reason you did char jpeg_name[8] instead of 9?

chevynova
Автор

why is sprintf giving me a segmentation fault?

KuraakaiGoro
Автор

It's been 2 weeks and this Pset still makes no sense to me

😒😮‍💨

yezganihara
Автор

please help me with this questions. I get a segmentation fault due to the fread function, the program stops executing once it arrives to the fopen .. here is my code FILE *card = fopen(argv[1], "r");

uint8_t buffer[512];
int number = 0;
int i = 1;
bool found = false;
FILE *pic = NULL ;
if(card == NULL){
printf("couldnt open\n");
}

while (fread(buffer, 1 , 512, card) ;) here is the problem
{ printf("working");

leilaaithamou