Project: Code your own PRINTF with zero libraries

Sdílet
Vložit
  • čas přidán 29. 08. 2024
  • Printf() is actually a more advanced function than obvious at first glance. In this video I will show you how to write your own implementation, completely from scratch, and without any libraries - not even the standard C libraries.
    To be able to solve this task, one must code own versions of the utility functions strlen, puts, putchar, itoa and others, as well as writing your own va_arg implementation in order to handle variable-length function parameters.

Komentáře • 8

  • @hamzaannane885
    @hamzaannane885 Před 4 měsíci +1

    🎉🎉🎉🎉🎉 Your are the best 🎉🎉🎉

  • @TjSBMD1810
    @TjSBMD1810 Před 4 měsíci +5

    Great video, but isnt malloc() and free() part of the stdlib?

    • @dr-Jonas-Birch
      @dr-Jonas-Birch  Před 4 měsíci +2

      hehe I mistakenly thought of malloc as a syscall, since it seems quite low level. so, good point. Im gonna use brk() instead or just change my function to use the stack instead. JB

    • @dr-Jonas-Birch
      @dr-Jonas-Birch  Před 4 měsíci +1

      I have corrected my mistake, check out my new Malloc video. And thank you for pointing that out. JB

  • @AmanKumar-jk1qu
    @AmanKumar-jk1qu Před 4 měsíci

    oh my god this is amazing 🙏🙏

  • @Crux161
    @Crux161 Před 2 měsíci

    Just change $PS1! 20:23 using a new home directory doesn’t feel like the best approach.. it’s not an ftp server and this isn’t the lcd 😬
    Edit: I suggest editing PS1 because it’s the closest you’ll get to intelligently setting the prompt without adjust important settings like $HOME which matters to $USER on the system running `uname -a` 😅

    • @dr-Jonas-Birch
      @dr-Jonas-Birch  Před 2 měsíci +1

      Hi crux, yeah but what do you suggest I change it to, specifically? I still need to see the relative path when I cd to subdirectories. Besides, Ive been using the same ps1 for many many years so it wouldnt feel right. And its kinda nice to be able to easily return to my project root by just typing cd.
      And I dont really use anything which needs access to the rc files for the local user.
      JB