Dynamic Memory Allocation using malloc()

Поділитися
Вставка
  • Опубліковано 22 лис 2024

КОМЕНТАРІ • 220

  • @prabhudinesh
    @prabhudinesh 4 роки тому +294

    nice voice command that attracts the audience to stay focused ....

  • @idellius7505
    @idellius7505 Рік тому +21

    I love that Neso often briefly revisits older topics as they become relevant to the current one in the video. Thank you so much for that extra effort in your lectures. It really helps tie all the material together to solidify a complete understanding. Great job!

  • @whatandwhy5862
    @whatandwhy5862 4 роки тому +36

    you channel is a gem .

  • @FranksCreativeCorner
    @FranksCreativeCorner 2 роки тому +5

    Thanks for the video, it's very well explained! I'd just add something important which is always remember to free the memory one we have used the variable and we won't do anything else with it. This is done with the 'free(variable)' function.
    Why, you'd ask? Malloc won't do it for us, it's not automatic like in happens in the static memory. So if we don't free the memory, it'll stay active indeterminately. This is called a 'memory leak' and if we're not careful it can accumulate or sometimes even filling all the memory available, leading to OS bugs or crashing the program.
    So again, that's why it's a good practice to always free the memory once we've used it.

  • @itsritika3561
    @itsritika3561 4 роки тому +99

    I can't thank you enough neso for these amazing lectures..🧡🙏🧡

    • @Shank2485
      @Shank2485 3 роки тому +1

      Neso is the best Dear ❤

  • @zahidhasan7052
    @zahidhasan7052 2 роки тому +3

    Best channel for CS students.

  • @kawsar.130
    @kawsar.130 3 роки тому +21

    I was searching for this type of explanation.
    This tutorial made me totally clear about the concept.
    Thank you.

  • @tula__
    @tula__ 5 місяців тому +3

    superb voice, intonation, explanation. Altogether superb video. 👌🙏

  • @7Strigiformes
    @7Strigiformes 4 роки тому +17

    You are a life saver. Thanks neso academy ❤❤

  • @tejaschaudhari1969
    @tejaschaudhari1969 6 місяців тому +1

    Great work!
    Excellent pedagogy and teaching style!!!
    Gratitude...

  • @Raphamerlo
    @Raphamerlo 2 місяці тому

    Straight to the point, it doesn't get any better than this! Thank youuu bro

  • @mfnomad815
    @mfnomad815 2 роки тому +3

    god-tier tutorial. you are a hero

  • @EdwinWade
    @EdwinWade 2 роки тому +1

    Phenomenal video and the tone of voice actually helps understand which part is very important to understand. 👍🏼

  • @Theodore2303
    @Theodore2303 10 місяців тому

    Still watching your videos since my first year of uni. Now in my final semester. Thank you sir!

  • @praneethvarma1364
    @praneethvarma1364 3 роки тому +2

    the way he teaches concepts is excellent and thankyou for such good presentation

  • @adameral3853
    @adameral3853 6 місяців тому

    i really appreciate your calm and intelligence while explaining thanks a lot

  • @saikatmitra3115
    @saikatmitra3115 4 роки тому +5

    Probably the best explanation !!!
    Good job sir !

  • @1997-aic
    @1997-aic Рік тому

    What a fabulous explanation, based on that 4 pages of A4 size, i wrote down it completely, Now i understood what is malloc and how it work internally. Thank you sir for sharing this valuable information, this is help me a lot.

  • @itsconfusing4725
    @itsconfusing4725 4 роки тому +1

    your way of telling and describing is amzaing NASO..
    #very helpfull video thx a lot

  • @arushitiwari5523
    @arushitiwari5523 3 роки тому +4

    Your explanation is awesome 🧡

  • @asthachauhan4880
    @asthachauhan4880 3 роки тому +4

    On the point and crisp thank you for this video!

  • @leetrothschild7465
    @leetrothschild7465 3 роки тому +3

    Thank you very much! I have a hard time understanding this in our lectures. But you make it so easy to understand.

  • @arjundas7078
    @arjundas7078 Рік тому +1

    Crystal clear. Thank you. ☺️

  • @Paiso_ka_gyan
    @Paiso_ka_gyan Рік тому

    Sir I love the way you teach, after watching your video, there is no room for doubts.

  • @SaiyanPrince-xy6sz
    @SaiyanPrince-xy6sz 3 місяці тому

    Finally understood what it is after a long search

  • @snehabk4113
    @snehabk4113 2 роки тому

    Without u i really can't understand c programming thanks for the lecture

  • @varunpatil5270
    @varunpatil5270 Рік тому

    Best channel 💯💯💯 for Programming..... ❤️❤️

  • @mathemagicstelugu7848
    @mathemagicstelugu7848 4 роки тому +2

    Thank you.,the best part is you came with a example...keep going ❤️❤️

  • @madhushreekulkarni3841
    @madhushreekulkarni3841 4 роки тому +2

    Thanks sir
    I am able to understand each and every concept very clearly..
    Hats off to you sir

  • @ganavin3423
    @ganavin3423 4 роки тому +1

    I think u are getting so much of love and happiness from ur beautiful work....I heartfully thanking you....u are really best teacher and u propogating ur knowledge to ur own mother earth family... thank you sir...I am happy with ur work...

  • @Forpc-h9d
    @Forpc-h9d Рік тому

    my english is not so good but the way you are teaching its really amazingg i didn't even understand the concept of malloc on other channels which are in hindi

  • @izazzubayer3233
    @izazzubayer3233 4 роки тому +6

    You are a C god!

  • @tanvirahmed5678
    @tanvirahmed5678 4 роки тому +3

    you are great. god bless you

  • @elaymisgav1879
    @elaymisgav1879 2 роки тому

    Explained so clearly.. Thank you very much!

  • @tamilmaranc
    @tamilmaranc 4 роки тому +3

    excellent video sir

  • @yourlinuxguy
    @yourlinuxguy 2 роки тому +1

    Keep making these videos to help STUDETNS!!

  • @kratikajain1463
    @kratikajain1463 11 місяців тому

    this was all i needed in a dma lecture

  • @sayandeepsoren361
    @sayandeepsoren361 7 місяців тому

    no.1 place to learn C....NESO Academy

  • @v8wr
    @v8wr Місяць тому

    I appreciate you guys SO MUCH

  • @divyasrivastava6424
    @divyasrivastava6424 4 роки тому +10

    Thank you so much for your detailed and clear explanation. It was very helpful and understandable.

  • @gleanfact8318
    @gleanfact8318 3 роки тому

    Wow What an Explanation @NesoAcademy........

  • @meerasarna6862
    @meerasarna6862 3 роки тому +1

    Thank You Sir For All The Lectures C lang, and Data Structure ❤❤

  • @aasthagupta7056
    @aasthagupta7056 2 роки тому

    no, thank YOU Mr. Neso for making this simple and easy-to-understand video. After you explained it, it was obvious really. ok. Love you. bye bye now.

  • @tassneemaltaf2001
    @tassneemaltaf2001 9 місяців тому

    Much needed explanation! Thank youuuu

  • @AimeHubHindi
    @AimeHubHindi 2 дні тому

    Superb lecture 🥰🥰

  • @xb44shubhambhagat62
    @xb44shubhambhagat62 3 роки тому +2

    I want to give 1000 likes for this video.

  • @asu2shh
    @asu2shh 4 роки тому +2

    i know its HARD but please Complete DS videos ASAP ! i'm just relying on you for my DS. THANK YOU.

  • @syntheticfiber7388
    @syntheticfiber7388 4 роки тому +3

    Excellent!

  • @diandongatamaku3210
    @diandongatamaku3210 5 місяців тому +1

    I've finally understood!!!!

  • @sharukh4963
    @sharukh4963 3 роки тому +1

    As simple as that
    love you man

  • @collegeWale.insane
    @collegeWale.insane 2 роки тому

    Thank you for clearing my concept.
    Thanks alot.

  • @carlosgruss7289
    @carlosgruss7289 2 роки тому

    Good quality video. Nice voice for narrating man!

  • @bunnythebun
    @bunnythebun Рік тому

    Thank you so much. You explained it really well.

  • @48_prasenjitmondal6
    @48_prasenjitmondal6 4 роки тому +2

    Salute your hardworking😍😍😍🥰

  • @manjorulgce3003
    @manjorulgce3003 3 роки тому

    very carefully explained. thank you.

  • @adityaojha2701
    @adityaojha2701 4 роки тому +5

    I was waiting for this.

  • @-micchaya-
    @-micchaya- 2 місяці тому

    very nice explanation

  • @SirMika9
    @SirMika9 Рік тому

    Very clear explanation. Thank you :)

  • @esha2688
    @esha2688 2 роки тому

    So preety good channel having point to point presentations, dulcet and clear voice and nice content!!! ;)

  • @saruulnasanjargal8590
    @saruulnasanjargal8590 2 роки тому +3

    Thank you for explaining this so clearly :)

  • @bullymaguire2335
    @bullymaguire2335 2 роки тому +2

    if (ptr == NULL){
    printf("memory not available:");
    exit(1);
    }: this block is causing error ; once i remove it everything is perfect
    help :)

  • @Learning_csip
    @Learning_csip Рік тому

    Superb! in one word

  • @abhinavsingh9629
    @abhinavsingh9629 2 роки тому

    Sirr you are absolutely stunning ✨✨..

  • @khushimattu9653
    @khushimattu9653 3 роки тому

    oh wow !! thank you so much. 😍i didnt understand anything my teacher taught but this video cleared all the concepts..

  • @chinakohl2355
    @chinakohl2355 Рік тому

    Thanks for the explanation

  • @devonscoles5705
    @devonscoles5705 2 роки тому +11

    You don't need to cast before malloc.
    It is unnecessary, as void * is automatically and safely promoted to any other pointer type in this case.
    It adds clutter to the code, casts are not very easy to read (especially if the pointer type is long).
    It makes you repeat yourself, which is generally bad.
    It can hide an error if you forgot to include . This can cause crashes (or, worse, not cause a crash until way later in some totally different part of the code). Consider what happens if pointers and integers are differently sized; then you're hiding a warning by casting and might lose bits of your returned address. Note: as of C99 implicit functions are gone from C, and this point is no longer relevant since there's no automatic assumption that undeclared functions return int.

  • @sriram1993mk
    @sriram1993mk 2 роки тому

    Great Explanation!!! Thanks...

  • @akritiyadav3873
    @akritiyadav3873 6 місяців тому

    Too good explanation

  • @royankit126
    @royankit126 4 роки тому

    malloc allocates a single large block of memory where calloc allocates sequential blocks of memory

  • @omarabbas6541
    @omarabbas6541 Рік тому

    brother, firstly thanks for everything you make.
    second i want to do some tasks on C language, so where can i find tasks and solve it.

  • @ahmedali3017
    @ahmedali3017 2 роки тому

    explain ..very excellent

  • @r.g.tutorials1846
    @r.g.tutorials1846 4 роки тому +1

    very helpful

  • @huzaifaahmed7006
    @huzaifaahmed7006 2 роки тому

    Superb LECTURES with amazing way of delivering concepts. :)

  • @mihaiflorianenache4110
    @mihaiflorianenache4110 Рік тому

    In last for loop you have write *(ptr+i) and this display the value (which was wrote by you before from keyboard). Please tell me what display &*(ptr+i).

  • @krishnachaitanyafoundation960
    @krishnachaitanyafoundation960 3 роки тому

    Ultimately superb 👌👌

  • @smartwolf9045
    @smartwolf9045 3 роки тому

    One word : Thanx . No three : thanx very much

  • @abhijitbarman4401
    @abhijitbarman4401 9 місяців тому

    You are the best!

  • @YM-uj3zl
    @YM-uj3zl Рік тому

    thank you so much! really appreciate your effort!

  • @mahmoudsamy1992
    @mahmoudsamy1992 Рік тому

    I there any lecture notes or handout for that awesome lecture ?

  • @josephmbote4167
    @josephmbote4167 3 роки тому

    Thanks a lot , concept made easy

  • @e.a7424
    @e.a7424 2 роки тому +1

    thanks bro!

  • @rahulRawat-lb7ku
    @rahulRawat-lb7ku 3 роки тому +1

    what is the name of your compiler??please suggest me one for c programming??

  • @monukarki9494
    @monukarki9494 2 роки тому

    and here we got the neso

  • @rikikikikikiki
    @rikikikikikiki Рік тому

    Thank you so much for your video!!!

  • @jasbindersingh6799
    @jasbindersingh6799 4 роки тому +1

    Thanks very useful..

  • @kunalsoni7681
    @kunalsoni7681 4 роки тому

    A very informative video too much 😇😇😇

  • @saijahnavi5447
    @saijahnavi5447 4 роки тому

    this video really helped a lot

  • @abdishakur2489
    @abdishakur2489 4 роки тому

    Great explanation, Thanks a lot bro

  • @ankitchaudhary6142
    @ankitchaudhary6142 4 роки тому +1

    Just precise!

  • @muralikris5445
    @muralikris5445 Рік тому

    ❤Easily understandable

  • @engineeringadda4553
    @engineeringadda4553 4 роки тому

    Good explanation....

  • @TechByte8
    @TechByte8 9 місяців тому

    This small program contains so many complex concept to understand this program completely.
    You need to understand how
    Address arithmetic for
    p+1
    You need to understand how *(p+1) is working.
    This program requires understanding of pointers in great detail.
    Thanks for the video. 🙏

  • @HarshitaBhati-ge5lg
    @HarshitaBhati-ge5lg 6 днів тому

    would u also take lectures of Java language ? pleasseee sirr

  • @sambhavsharma1547
    @sambhavsharma1547 2 роки тому

    Thankyou so much sir

  • @redrose5950
    @redrose5950 4 роки тому

    Is it like we are creating first block of memory using malloc() and then using pointer we will accessing the next memory location for storing the 2, 3... Variable values in those locations? Is it the concept which is explained in this program? Please explain Sir

  • @lalithag9352
    @lalithag9352 3 роки тому

    Tqs a Lott🙂🙂 my teacher💞 u r my teacher whether u not in front of me but I learning from u teacher

  • @LegendaryStickman488
    @LegendaryStickman488 2 роки тому

    thank you for your lecture. but shouldn't the program contain free(ptr) at the end? the memory is allocated at heap, but is not freed after

  • @doxsh8853
    @doxsh8853 Рік тому

    Thankyou sir❤

  • @gorripativenkateswararao1127
    @gorripativenkateswararao1127 2 роки тому

    Nice voice sir

  • @HelloWorld40408
    @HelloWorld40408 Рік тому

    Thank you sir