recover

Поделиться
HTML-код
  • Опубликовано: 16 янв 2025

Комментарии • 21

  • @Hakiros54
    @Hakiros54 5 лет назад +7

    should i be able to write this program at this stage of course?

  • @JohnQuinn93
    @JohnQuinn93 7 лет назад +10

    at 1:15, the "last byte" should either say the "last byte of header" or "fourth byte" to be more clear. If not for the conditional statement given later the video I would have thought, the last byte of the entire JPEG was the value given, rather than the last byte in the header.

    • @dante_ele
      @dante_ele 6 лет назад +3

      1:27 She did say that.

    • @cscs9948
      @cscs9948 4 года назад

      You are right.

  • @zoachim
    @zoachim 5 лет назад +4

    fread(buffer, 512, 1, card) returns 1 if it manages to read it.

  • @roybasilthompson5715
    @roybasilthompson5715 5 лет назад +1

    Could someone explain why the conditional at 4:39 evaluates to true?

    • @arik4802
      @arik4802 5 лет назад +11

      a single ampersand (&) is a bitwise function: it basically takes the binary forms of two numbers (in this case buffer[3] and 0xf0) and returns the result of whether each digit is a 1 or a 0. (i.e., if the first digit of both numbers is 1, it will return one as the first digit; if either or both of the first digits are 0, it will return 0 as the first digit; and so on.) (buffer[3] & 0xf0 == 0xe0) will return as true only if the first three digits in buffer[3] are all 1s and the fourth digit is 0. the test does not care about the second half of the hexadecimal of buffer[3] because no matter what it will return zero because it's being compared with 0xf0. so basically this is a way to test if the first half of buffer[3] is 0xe, notwithstanding whatever's in the second half. :)

  • @seacresthill
    @seacresthill 6 лет назад +1

    Dig into the card.raw a little and look at the first few bytes in the 2nd 512 byte block for a treat

    • @dfla5472
      @dfla5472 3 года назад

      how u do it?

  • @AshBrim
    @AshBrim 8 лет назад +1

    OMG, "Death Sphere"!!!))))))

  • @amarudemonn
    @amarudemonn 5 лет назад +2

    Well, what's in card.raw? What is the type of buffer?

    • @amarudemonn
      @amarudemonn 5 лет назад

      OK. It's a char.

    • @amarudemonn
      @amarudemonn 5 лет назад

      Now I don't understand how to stop writing bytes into a jpg, close it and start a new one.

    • @amarudemonn
      @amarudemonn 5 лет назад +1

      Did it! Pset3 is now completed. That was not so funny actually. But great practice.

    • @fahimhuq2768
      @fahimhuq2768 4 года назад

      Congrats

  • @huanghowie4570
    @huanghowie4570 4 года назад +2

    Can someone explain the sprintf function?

    • @shoaib3356
      @shoaib3356 4 года назад +1

      It stores and formats an output into a pointer(string or array of chars). In this problem, you'll use it to store and format the name of the file.

    • @huanghowie4570
      @huanghowie4570 4 года назад

      @@shoaib3356 OK thanks

    • @Z0Gab
      @Z0Gab 4 года назад

      Just as printf evaluates and shows into the screen, sprintf evaluates and stores into an string thats referenced in the first argument.

  • @mohamedabdallah8799
    @mohamedabdallah8799 5 лет назад

    can any one code this program??