Just enough C to have fun

แชร์
ฝัง
  • เผยแพร่เมื่อ 21 พ.ย. 2024

ความคิดเห็น • 164

  • @Kelsu_
    @Kelsu_ 3 หลายเดือนก่อน +76

    One of the best C classes that i have seen in my whole life, way better than the college classes i attended. I apreciate

    • @neoeno4242
      @neoeno4242  3 หลายเดือนก่อน +5

      Thanks :)

    • @Michaelno
      @Michaelno 20 วันที่ผ่านมา

      Ok first comment, i'm about follow along. we will see :)

  • @ProVrakian
    @ProVrakian 2 หลายเดือนก่อน +39

    Thank you for treating your audience like adults. This is the right amount of fast-paced and insightful.
    I appreciate a video that is meant to inspire people to dig deeper.

  • @maxmustermann5590
    @maxmustermann5590 14 วันที่ผ่านมา +3

    Man I knew this stuff and still watched it to completion. You have a lovely style presenting and I could listen to you talk about nerdy topics all day

  • @Artem1I9a
    @Artem1I9a 2 หลายเดือนก่อน +8

    The best explanation of how memory works that I've ever seen. Very clear. Thanks for your effort.

  • @ivankevamo
    @ivankevamo 3 หลายเดือนก่อน +46

    Great job. I have to thank the youtube algorithm for suggesting your channel. Thanks a lot. Greetings from South America.

    • @djianstankovich100
      @djianstankovich100 3 หลายเดือนก่อน +1

      i agree with you and my greetings from Egypt 👏💪

  • @simonegalli5453
    @simonegalli5453 หลายเดือนก่อน +2

    The step by step visualization of all the memories involved was reslly well done. Thank you to spread knowledge.

  • @laxmanneupane1739
    @laxmanneupane1739 หลายเดือนก่อน +1

    Just watched this. The density of information is quite spot on.

  • @Humble_Electronic_Musician
    @Humble_Electronic_Musician 3 หลายเดือนก่อน +21

    The content and presentation is top notch.
    I also like your eloquent speech: I'm interested in low level programming, but even if i was not, I would probably listen to this vid.

  • @4xl45cd
    @4xl45cd หลายเดือนก่อน

    I came across the training series on C/C++ from sharing developments on different sites. I'm glad I came across it. There are many training series on C programming language, but none of them are as detailed and connected as you described. Thank you for your efforts. Greetings from Turkey. Good work.

  • @LuzHarlott
    @LuzHarlott 2 หลายเดือนก่อน +1

    Thanks for the video! I haven't used C in years and had forgotten how fun it is, this will be a great refresh for me :)

  • @andrewwdavid
    @andrewwdavid 24 วันที่ผ่านมา +2

    honestly such a refreshing video on C,

  • @kscd009
    @kscd009 3 หลายเดือนก่อน +5

    Gold mine of content. This deserves much more audience

  • @caesarespinosa3131
    @caesarespinosa3131 หลายเดือนก่อน

    Magnificent classes you give Dear Kay, most grateful to you and thanks for your efforts

  • @pavalep
    @pavalep 2 หลายเดือนก่อน +2

    kay..thanks for this awesome series. Im a react native developer who is interested to learn thee nitty gritty of coding. but actually lacks the core concepts. will be following ODES series as i find the videos very enlightening👍

  • @GreeneThumbs
    @GreeneThumbs 3 หลายเดือนก่อน +2

    I've recently started learning C, and this video is perfect. I really like the format and presentation. Thank you!

    • @50lek
      @50lek 3 หลายเดือนก่อน

      I need to learn C++ for work, and its also really complicated in my opinion. What do you think?

  • @chowder9576
    @chowder9576 3 หลายเดือนก่อน +2

    I randomly saw this on my TH-cam feed and so glad I watched. I don't even code in C but it was interesting learning something new! I hope to see more videos! :)

  • @obrikash9123
    @obrikash9123 3 หลายเดือนก่อน +1

    I really enjoy your videos as i had some experience with c++ and i almost understand all of just C. I think this video format is great for people who are already informed about basics, pointers and memory concepts. Love from Moscow, Russia

  • @goingupandupandup
    @goingupandupandup 2 หลายเดือนก่อน

    This is the best lesson on C I have ever watched. Thanks a bunch

  • @UliTroyo
    @UliTroyo 3 หลายเดือนก่อน +11

    C really is fun! And because it's been around for so long, used textbooks on Amazon are dirt cheap.

    • @stefanalecu9532
      @stefanalecu9532 2 หลายเดือนก่อน

      I don't see you making the same argument for Fortran and Pascal ;)

  • @SuncoastSoftware
    @SuncoastSoftware หลายเดือนก่อน

    I wish you taught c#, I love the way you "teach".

  • @lautarolopez9992
    @lautarolopez9992 หลายเดือนก่อน

    Your content is PURE GOLD Kay, thank you!

  • @gepacc
    @gepacc หลายเดือนก่อน

    Some of the best programming content on TH-cam!

  • @charlesmarseille123
    @charlesmarseille123 3 หลายเดือนก่อน

    the explanation of the function pointer in the memory space is great. well done.

  • @deutschWallah
    @deutschWallah 2 หลายเดือนก่อน +1

    Hey Kay, this is really good class. I hope you take more of such classes, maybe involving more of gdb and valgrind and other mess which we usually face 🙂 Really really good work.

  • @veto_5762
    @veto_5762 3 หลายเดือนก่อน

    I don't even know why I'm watching this since I've been using c++ for like 3 years now, still nice video

  • @dominichawkins7997
    @dominichawkins7997 2 หลายเดือนก่อน +1

    Poor hand writing is a sign of intellect':] You rock!

  • @hasanhuseyinyurdagul5403
    @hasanhuseyinyurdagul5403 3 หลายเดือนก่อน +1

    The presentation and whole video overall was very smooth, even though I already knew this stuff, I watched until the end. Subscribed, very good content.

    • @neoeno4242
      @neoeno4242  3 หลายเดือนก่อน +1

      Appreciate it!

  • @riebeck1986
    @riebeck1986 24 วันที่ผ่านมา +1

    Great video ! So much information, but is so well presented and clear !

  • @ItsRyanStudios
    @ItsRyanStudios 3 หลายเดือนก่อน

    I've been having a crisis of meaning lately; I love my work as a web dev, but every day I'm just writing bloat.
    I was looking for a good intro to C or embedded development; grateful the algorithm sent your channel to me 👍

  • @sournois90
    @sournois90 หลายเดือนก่อน

    hello i love you this is literally the best c video on the internet

  • @axelqt1
    @axelqt1 หลายเดือนก่อน

    Thanks a lot for this, others would have taken at least 4 hours for this amout of information, really appreciate it

  • @kriszenn1125
    @kriszenn1125 2 หลายเดือนก่อน

    The for-loop is syntactic sugar for a while loop with the following setup:
    initialization;
    while (condition) {
    increment;
    }
    and its equivalent for-loop
    for (initialization; condition; increment) {
    }
    EDIT: i think it's easier to think of a for-loop as:
    for (before; during; after) {
    }
    but that can be confusing too. "During" is the condition that is technically checked *before* running the , but one can say that it's constantly being checked *during* the loop. "Before" is self-explanatory, but "after" seems confusing. "After" is code run after the has done its thing.

  • @devoiddude
    @devoiddude 3 หลายเดือนก่อน

    I have a background in java and actually started in C last week, was openai to help me show examples etc but this video was very helpful, thanks so much!

  • @modolief
    @modolief 3 หลายเดือนก่อน +1

    Good explanatory content for beginning C programmers.

  • @MrAguaconazucar
    @MrAguaconazucar 2 หลายเดือนก่อน

    This is a work of art. Keep up with the good job. Im thankful for this resource

  • @bradmccoy1747
    @bradmccoy1747 3 หลายเดือนก่อน

    I enjoyed this video. I liked how you connected everything together. I am a less than beginner level in C. I have been in Assembly for quite a while now. I have have bounced into all of these concepts during my own writes and you lay it out so nicely and I like how it doesn't have to be fast and skippy. The whole concept of a function returning data has bothered me for some time now. The concept is an abstraction from what is really happening. A function call is really just a sugary goto but with a fancy way to return to the next line after the goto. And when the function does return; it just cannot carry data with it - LOL. But it could have altered the values in the registers. And our ancestors created a fancy trick by altering the RAX (EAX, AX, AL, AH) register; then copying that new value into a variable on the caller side. This gave the illusion in our beloved gen 3 languages that a function may return a value. But it really didn't, it just changed a register value. My point is that now everyone wants to return big stuff from functions and it has just gone too far. Ok - thats my rant for the day. And your video supports my thoughts with realistic examples. Love it!

    • @neoeno4242
      @neoeno4242  3 หลายเดือนก่อน +1

      Thanks for the comment! Really enjoyed reading it. I'm looking forward to getting more into building up the 'function' abstraction through assembly in the next couple videos. Was just playing around with it today actually. Exciting!

  • @adekorir
    @adekorir 3 หลายเดือนก่อน +1

    perfect for my reintroduction to the c programming language.

  • @dixztube
    @dixztube 3 หลายเดือนก่อน

    Just had to comment again and I’m a new subscriber. This was so good. You’re very intelligent and explain things well. Made all this seem very easy

  • @onurolce
    @onurolce 2 หลายเดือนก่อน

    What a calm person you are !:) First time I've watched your video. So let me check your playlists :)

  • @MarianoBustos-i1f
    @MarianoBustos-i1f 3 หลายเดือนก่อน

    This comment works roughly as you would expect it: you make an awesome video, I comment nice stuff.

  • @AnimeKing-m2t
    @AnimeKing-m2t 3 หลายเดือนก่อน

    Such an amazing talk...pure code and explanations.

  • @cincooitodois
    @cincooitodois 3 หลายเดือนก่อน +1

    youre awesome, kay! learning a lot from you. thanks!

  • @1732ashish
    @1732ashish 3 หลายเดือนก่อน

    thanks for this crisp, to the point video.

  • @codephilosopher
    @codephilosopher 2 หลายเดือนก่อน

    Thank you, your videos are very enjoyable to watch.

  • @twenty-fifth420
    @twenty-fifth420 หลายเดือนก่อน

    For better or worse, this is the video I need to see. I am working on a modern immediate GUI for myself, for fun (and maybe 'profit' for as far as I can go with FOSS!).
    Better late then never I suppose!
    Edit: 2:22 *shoves nerd glasses* What you refer to as 'Lie-nuhx' is in fact, 'GNU + Linux' or simply the 'Linux' stack.

  • @nazneenzafar743
    @nazneenzafar743 3 หลายเดือนก่อน

    Thanks for the lesson. I hope you keep up with producing awesome content.

  • @betoperalta701
    @betoperalta701 หลายเดือนก่อน

    You have a nice smoothing voice

  • @latch909
    @latch909 2 หลายเดือนก่อน

    This rules, someone lovely making nice videos about C what could be better

  • @4ozmane
    @4ozmane 3 หลายเดือนก่อน

    The clip cuts are nice to keep things moving, keep making educational videos plz

  • @caspersro
    @caspersro 2 หลายเดือนก่อน

    i like your way of giving the information good work really i have a little knowledge of C Language so i may ask you to teach me and others like me C Language like this way
    Thank you in Advance 😍😍😍😍😍

  • @johnsteve1276
    @johnsteve1276 2 หลายเดือนก่อน

    Great content. Appreciate your hard work. Btw, could you make a video about C++ ?!

  • @offlinemark
    @offlinemark 3 หลายเดือนก่อน

    Great video, thanks! I'm using C to build a little hobby os for fun, and this is a nice refresher video :)

  • @bzboii
    @bzboii 15 วันที่ผ่านมา

    7:20 aaaand you’ve reimplemented godbolt :)

  • @z0rba566
    @z0rba566 2 หลายเดือนก่อน

    thank you yt! thank you Kay! can I request for a holy-C playlist !

    • @neoeno4242
      @neoeno4242  2 หลายเดือนก่อน +1

      Just added playlists to my todo list!

    • @Satyam1010-N
      @Satyam1010-N หลายเดือนก่อน

      ​@@neoeno4242 pdf too, I find enterprise design architecture very hard , basic intermidate is on yt , I wish get to to projects live ( pre record ed)

  • @Gersberms
    @Gersberms 3 หลายเดือนก่อน

    I really love your style of presenting the source, the structure of your story, and just the easy going nature of it all. I will gripe about using two spaces for indentation, so -1 point for that, but +2 points for showing simple macros so that I now no longer feel that I need to avoid them. Thanks! Oh and, printf is super slow because I believe it's monstrously complex, so that might be worth mentioning (plus security risks I believe). And is make really worth using?

    • @neoeno4242
      @neoeno4242  3 หลายเดือนก่อน +2

      Thanks! And all good points - I can definitely feel the complexity of printf coming through when I reach for it :) Re: make, with these videos questions like that are often a balancing act. Could use a plain shell script but then learners might not remember make at all and that can be confusing later, or could go for something more fully featured and then you're going to also have to include setup instructions and risk diverting attention. My angle is often trying to put people in a position where they've encountered the right set of things to then go build on the basics later - rather than taking a sophisticated approach early on and getting muddled. Could easily argue for other tradeoffs though! Anyway, thanks for the comment :)

    • @Gersberms
      @Gersberms 3 หลายเดือนก่อน

      @@neoeno4242 You're right about make and your approach. This was more of a personal curiosity, and not a comment on your content. I got inspired by Handmade Hero that a batch file or shell script will suffice because usually it's just a few lines of mkdir, copy, gcc and run. So I have come to rely on a simple VS Code "skeleton project" as I clumsily called it that does these things: build, debug, and test. Whatever language I'll use is not even important because the concept works for whatever I'm making.
      You done any video on git yet? VS Code and git are a match made in software heaven.

    • @neoeno4242
      @neoeno4242  หลายเดือนก่อน

      Not yet! Good idea though, thanks :)

  • @Tenshi-sk8ty
    @Tenshi-sk8ty 3 หลายเดือนก่อน +41

    bro is majestic

    • @2wheels2
      @2wheels2 3 หลายเดือนก่อน +1

      bro is trans

    • @thomasredden3159
      @thomasredden3159 3 หลายเดือนก่อน +6

      she is slaying physically and intellectually 💅

    • @bmno.4565
      @bmno.4565 3 หลายเดือนก่อน

      Agreed, what a fierce flow.

  • @mantra578
    @mantra578 3 หลายเดือนก่อน

    i really had fun watching this

  • @clintquasar
    @clintquasar 3 หลายเดือนก่อน +1

    Great teacher!

  • @calderarox
    @calderarox 2 หลายเดือนก่อน

    this is a great video! thanks for sharing

  • @dixztube
    @dixztube 3 หลายเดือนก่อน

    Wonderful job!

  • @mrinalyadav4261
    @mrinalyadav4261 3 หลายเดือนก่อน

    this series is grt.

  • @Marco-pz5dx
    @Marco-pz5dx 3 หลายเดือนก่อน +51

    I liked the video, but honestly probably a bit too hard for beginners. Honorable mission though. In particular, the attempt to simplify some topics may actually end up misleading: on discussion about returning strings, I can see how you really try to explain variables' lifetimes but without mentioning them explicitly only focusing on the example. I would try to instead insist on the notion of lifetime and then go on explaining why callee variables on stack cannot outlive their lifetime and be accessible from parent (i.e. they "expire" upon return, and thus caller's attempt to access that now potentially overwritten stack memory is flawed). I would also showcase how a struct wrapping the fixed size array is possible due to return semantics.

    • @neoeno4242
      @neoeno4242  3 หลายเดือนก่อน +27

      Such an interesting perspective - thanks for sharing, appreciate it and I'm sure others will too.

    • @jamesdoe2139
      @jamesdoe2139 3 หลายเดือนก่อน +1

      @neoeno4242 do you have a Discord server/are you a Discord user?

    • @parallelno
      @parallelno 2 หลายเดือนก่อน +2

      Thank you for the video. Please review the memory dump you're showing. Each line should display 16 bytes, but yours only shows 8. Additionally, please verify the byte order. On most modern architectures, it should be little-endian, meaning the smaller byte appears first.

  • @FocusAccount-iv5xe
    @FocusAccount-iv5xe 3 หลายเดือนก่อน

    This was wonderful. Thanks!

  • @fazin85
    @fazin85 หลายเดือนก่อน

    great video :)

  • @werren894
    @werren894 2 หลายเดือนก่อน

    This is awesome!

  • @salim444
    @salim444 3 หลายเดือนก่อน

    the first this I do in an empty main is allocate 5k array just for the sake of it. Feels great to allocate arrays and then free it

  • @t1nk3rtail0r
    @t1nk3rtail0r 2 หลายเดือนก่อน

    Very, very good !

  • @josephlagrange9531
    @josephlagrange9531 3 หลายเดือนก่อน

    Hi, I subscribed yesterday.

  • @Marc-Tu
    @Marc-Tu 3 หลายเดือนก่อน

    Nice video. And I like your shirt. It looks good on you.

    • @neoeno4242
      @neoeno4242  3 หลายเดือนก่อน

      Thanks!

  • @ru2979
    @ru2979 17 วันที่ผ่านมา

    Please make more C videos 😢🙏🏼🙏🏼🙇🏼🙇🏼Please please ❤

  • @PowerLlama
    @PowerLlama 8 วันที่ผ่านมา

    "those fast counters will know" lol

  • @egu00
    @egu00 3 หลายเดือนก่อน

    enjoy your video, thanks!

  • @ytbacc0001
    @ytbacc0001 3 หลายเดือนก่อน +1

    Thank you for this video

  • @jimshtepa5423
    @jimshtepa5423 3 หลายเดือนก่อน +2

    do you have a map of topics you plan to cover in the next10-15 videos?

    • @neoeno4242
      @neoeno4242  3 หลายเดือนก่อน +7

      Working on it :) At the moment I'm working towards creating binary executables from scratch as a little milestone. That will involve spending a bit more time working with binary data, file formats, syscalls, and ASM. I think my planning will solidify in the next few months - will share more as that solidifies!

  • @VforVanish
    @VforVanish 2 หลายเดือนก่อน

    If the memory is allocated with malloc and returned, if we call printf it wont be corrupted no?
    That problem was because the array was on the stack?
    Very interesting videos an great teacher!

    • @neoeno4242
      @neoeno4242  2 หลายเดือนก่อน +1

      Yes that's correct!
      Though if we use malloc in the function then we will have to decide when to free or 'give back' that memory (since in C nothing will free it up automatically and if the function is called repeatedly this will eventually use up a lot of memory).
      So string functions in C instead typically take a pointer to a buffer as an argument and then alter that buffer. That way the caller is responsible for allocating and freeing memory however they see fit.

  • @MagicalCritical
    @MagicalCritical 27 วันที่ผ่านมา

    can we have some cintent on testing (windows) ?

  • @energy-tunes
    @energy-tunes หลายเดือนก่อน

    Very high quality channel

  • @uuuweee
    @uuuweee 4 วันที่ผ่านมา

    I tried printing junk data just like at 27:04 on my machine using Clang version 14.0.0-1ubuntu1.1, but the data was not junk. When I used GCC, I got a Segmentation fault. After some research, I found that by setting the -fsanitize=address and -fsanitize-address-use-after-return=always flags, it detects stack use and fails. I wonder why I couldn’t print a junk value on my machine.

  • @seekyou
    @seekyou 3 หลายเดือนก่อน

    watching this quite cool video feels a little bit like stealing for the goodness received for free!

  • @antonio_carvalho
    @antonio_carvalho 2 หลายเดือนก่อน

    Spec requirement: high tech title card. ☑️

  • @sadramohh
    @sadramohh 5 วันที่ผ่านมา

    3:47: "Lowercase Zero" xD

  • @rescyy2235
    @rescyy2235 3 หลายเดือนก่อน +3

    What text font are you using?

    • @neoeno4242
      @neoeno4242  3 หลายเดือนก่อน +6

      Largely: Monaspace Xenon for the code font, and Mona Sans for the rest. Sometimes I mix up the monaspace font families though :)

  • @estebanmorales9736
    @estebanmorales9736 2 หลายเดือนก่อน

    incredible

  • @Isaac-zy5do
    @Isaac-zy5do 2 หลายเดือนก่อน

    At 14:00 i think it should either be nums[0] = 0x10; nums[1]=0x20; etc or 0a 14 1e in memory

  • @zyhru
    @zyhru 2 หลายเดือนก่อน

    Isn't the second solution with malloc more flexible since there might some situations where you don't know length of the string at compile time?

    • @neoeno4242
      @neoeno4242  หลายเดือนก่อน +1

      Yes - it definitely has that advantage. Though it has some other disadvantages, for example that allocating memory takes a bit of time and someone has to remember to free it up. Many (not all) C programmers prefer fixed-length buffers to malloc for certain tasks. If you're used to higher level languages this might feel weird though!

  • @onurolce
    @onurolce 2 หลายเดือนก่อน

    12:46 unsigned char MAX should be +255 , am I wrong ?

  • @christopher8641
    @christopher8641 3 หลายเดือนก่อน

    great! video

  • @DeeBash
    @DeeBash หลายเดือนก่อน

    @19:55 Is it padding, between two string addresses? exactly at 0x0014 (based on correct addressing).
    if it's not padding then why extra 00 stored in between two strings. I can understand the null pointer at the end of strings, but why extra zero at 0x0014

    • @neoeno4242
      @neoeno4242  หลายเดือนก่อน +1

      Good question - that one is just arbitrary. I wanted to indicate for the purposes of the demonstration that I'm not describing precisely where strings will definitely get put in memory. The values aren't packed perfectly so that people won't accidentally assume that they are. In the real world, there might be many reasons - could be padding/alignment, could be the C compiler is deciding to store other values there, could be other reasons, or it could be that they get packed perfectly!

    • @DeeBash
      @DeeBash หลายเดือนก่อน

      @@neoeno4242 thank you for the explanation. I thought C is just like assembly(.align 4). But from your explanation, we can't be sure how data is packed/ordered in memory. I'm sad now.

  • @manfredbogner9799
    @manfredbogner9799 3 หลายเดือนก่อน

    Sehr gut

  • @sanctuary_of_soul
    @sanctuary_of_soul 3 หลายเดือนก่อน

    at 8:32 i believe there is something off in how the sentence is composed logically.
    "...it just gets inlined straight into the file, and everything in the other C file gets chunked into the C file we are including from..."
    "...chunked into the file we are including from..." does it?
    Or am i missing something?

    • @BoardGameMaker4108
      @BoardGameMaker4108 3 หลายเดือนก่อน

      You are right, that might be a small mistake. For anyone looking at this later, it just does a simple copy and paste (from the other file into your file).
      By convention, we also generally separate code into two files "header files" (.h) contain code that you want to be copied into other files (you can #include them). Implementation files (.c) contain code that you don't want to (or can't) copy around. One thing to note is that you cannot copy function implementations, so leave the implementation in a .c file, and the declaration in the .h file. This lets you use the function in other places without having multiple functions with the same name causing a linking error.

    • @neoeno4242
      @neoeno4242  3 หลายเดือนก่อน

      Yes it's not super clear - thanks for flagging and also to @BoardGameMaker4108 for clarifying. Appreciate it.

  • @ArthurSchoppenweghauer
    @ArthurSchoppenweghauer 2 หลายเดือนก่อน +1

    thanks bro!

  • @richardappow6770
    @richardappow6770 3 หลายเดือนก่อน

    what code editor are you using here?

    • @neoeno4242
      @neoeno4242  3 หลายเดือนก่อน

      VS Code :)

  • @vasantheee
    @vasantheee 3 หลายเดือนก่อน

    Is it possible that the assert without printf could also fail at 25:10 because buffer variable is reallocated to something else? I am not sure why it is stated here that the program fails only after printf is added.

    • @anon_y_mousse
      @anon_y_mousse 3 หลายเดือนก่อน

      Because it's on the stack and the stack is changed after calling printf(). Literally any function which makes use of some stack space would have the same effect.

    • @vasantheee
      @vasantheee 3 หลายเดือนก่อน

      ​@@anon_y_mousse but even without modifying our program, it is possible that stack memory could be allocated or used by some other program and there is no gurantee this program would work everytime (without printf Or any other change) right?

    • @anon_y_mousse
      @anon_y_mousse 3 หลายเดือนก่อน

      @@vasantheee I certainly wouldn't depend on it being valid after the function call, but OS's typically will allocate a stack per thread or process, depending on configuration. However, depending on what the compiler does to your code, even if you don't make a function call, it's likely that data higher up on the stack could be instantly invalidated upon function return. For older chips and microcontrollers, if you have a stack at all, then all parameters would be passed on the stack, generally, and then upon return, anything allocated off the stack inside the function would be instantly invalidated. For newer chips, it's pretty much a given that parameters will be passed by register if you have few enough parameters, but the compiler might very well finagle your code such that it has to push and pop some data around the function call which would thus invalidate the array.
      In short, you don't have to worry about other programs running on the system invalidating your stack because your own program will likely do it without you directly seeing the effects.

    • @vasantheee
      @vasantheee 3 หลายเดือนก่อน

      @@anon_y_mousse thank you. So we cannot count on the program being successful like it happened at 25:10 all the time, right?

    • @anon_y_mousse
      @anon_y_mousse 3 หลายเดือนก่อน

      @@vasantheee I would say we shouldn't ever count on it. The thing to remember, if you want to work with an array, pass it into the function. If you want it to be resizable, then pass the address of the pointer. If you want to do dynamic arrays, then consider using a struct and passing the address of that struct, say typedef struct { size_t length; int data; } array_t; and just replace int with whatever type you wish to have an array of. You could even make the array type something like int_array_t or array_int_t or whatever name you feel like.

  • @ga1agen
    @ga1agen 3 หลายเดือนก่อน

    19:13 - what the hell each 4 bits have its own address? x86 cpus can only address minimum a one byte(8 bit)... and other cpus, except microcontrollers( where part of memory can be 1-bit addressed for gpio)

    • @neoeno4242
      @neoeno4242  3 หลายเดือนก่อน +2

      Ah yes, my mistake - thanks for flagging. I mistakenly gave each digit its own address, which isn't correct! Should be something more like this: link.excalidraw.com/readonly/KooN4ScH7IO4QuRsZtEG

  • @fevicoI
    @fevicoI 14 วันที่ผ่านมา

    Honest question, are you a male or female? My 5 yo son asked this question!

  • @yanovoyair5129
    @yanovoyair5129 13 วันที่ผ่านมา

    computer science is super dense , bruv

  • @SimGunther
    @SimGunther 3 หลายเดือนก่อน +2

    TL;DW
    Noob: Why does the program segfault? I'm too used to OOP!
    Expert: The stack does too good a job cleaning itself up, which is why you can't just return an array like that in your string concat function.
    Noob: Seriously, why doesn't it work like I expect it to?
    Expert: Because with great memory control comes great responsibility.
    Noob: So I can just make a big array at the beginning of the program and use that instead of worrying about free andMalloc?
    Expert: That's what I do in my prototypes anyway until I find it necessary to allocate such memory by hand.
    Noob: I'll just stick with JS and hope for the best.
    Expert: Wait a minute, you can still leak memory in J-
    Noob: _Sees browser crash due toOOM error_ Thanks anyway, I'll just stick with my abacus. At least that doesn't break on me when I least expect it to...

    • @neoeno4242
      @neoeno4242  3 หลายเดือนก่อน +1

      This is my fave one: th-cam.com/video/GcDshWmhF4A/w-d-xo.html

  • @JohnDoe-kh3hy
    @JohnDoe-kh3hy 3 หลายเดือนก่อน +1

    Excuse me, young fellow. May you please provide me with some advice on how to become a professional (or better yet, dangerous) C programmer. Thanks a bunch

    • @neoeno4242
      @neoeno4242  3 หลายเดือนก่อน +1

      By way of advice on going pro with C I'm not sure I have anything really revelatory - it does appear like safer systems languages like Zig, Go, Rust are gaining popularity lately. If you're looking into C though, common pro books I see recommended are: C Programming, A Modern Approach by K N King and The C Programming Language by Kernighan, Richie. On top of that, write a lot of code and ideally run it yourself day to day :) Why use the built in `ls` when you can make your own and feel all the pain when it doesn't work? Wishing you good fortune.

  • @omnilistic
    @omnilistic 3 หลายเดือนก่อน +1

    bruh you pretty as hell T_T

  • @RossDmoch
    @RossDmoch 3 หลายเดือนก่อน

    But what if want to live dangerously in C? 😂

    • @neoeno4242
      @neoeno4242  3 หลายเดือนก่อน +1

      Then use after free all you like 😈