C_133 Dynamic Memory Allocation using malloc() | C Language Tutorials

แชร์
ฝัง
  • เผยแพร่เมื่อ 19 มิ.ย. 2024
  • C complete playlist: • Programming in C
    Use my code jkl10 to get 10% off on GATE subscription
    GATE Subscription- unacademy.com/goal/gate-ese/P...
    Evolve for GATE 2023 (CS & IT) - Batch unacademy.com/batch/evolve-fo...
    Spark for GATE 2023 (CS & IT) - Batch D (English)- unacademy.com/batch/spark-for...
    Ascend for GATE 2024 (CS & IT) - Batch G- unacademy.com/batch/ascend-fo...
    Connect & Contact Me:
    Vlogging Channel Link: bit.ly/354n7C7
    Facebook: / jennys-lectures-csit-n...
    Quora: www.quora.com/profile/Jayanti...
    Instagram: / jayantikhatrilamba
    Twitter: / khatrijenny
    See Complete Playlists:
    Placement Series: • Placements Series
    Data Structures and Algorithms: https: • Data Structures and Al...
    Design and Analysis of Algorithms(DAA): • Design and Analysis of...
    Dynamic Programming: • Dynamic Programming
    Operating Systems: // • Operating Systems
    DBMS: • DBMS (Database Managem...
    #Cprogrammingtutorials
    #DynamicMemoryAllocationinC
    #mallocfunctioninC
    #Jennyslectures

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

  • @grow_free
    @grow_free ปีที่แล้ว +192

    In static memory allocation you have a glass full of water and in dynamic memory allocation you have an empty glass and a jug and you can take as per your need.

  • @user-su6gl9cz6z
    @user-su6gl9cz6z 8 หลายเดือนก่อน +12

    1. Static Memory Allocation (Toy Shelves):
    Imagine you own a toy store, and you have a fixed set of shelves with five slots. Each slot can hold a different toy. You decide in advance which toys will go into each slot. Once the toys are placed, you cannot change the shelves' structure, and the toys in those slots are fixed. This is similar to static memory allocation.
    2. Dynamic Memory Allocation (Toy Store with Adjustable Shelves):
    Now, imagine you own a toy store, but this time you have the ability to add or remove shelves as needed. You start with an empty store and add shelves to accommodate toys as customers come in. If a customer leaves, you can remove the shelf to free up space. This represents dynamic memory allocation.

  • @staywithmiseren6754
    @staywithmiseren6754 2 ปีที่แล้ว +35

    Ma'am I am from northeast! Currently doing my BSC in Cs ! Your videos make programming even more better and easier! ✌️❤️❤️❤️

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

      me also in same course

  • @suguflick119
    @suguflick119 ปีที่แล้ว +8

    Ma'am, your ways of explaining concepts are too good, I learnt C and C++ at least 2 decades ago. Wish we had someone like you to teach us, would have aced it for sure.
    Thank you so much for your support.

  • @charimuvilla8693
    @charimuvilla8693 2 ปีที่แล้ว +12

    Hi Jenny love your videos! I would be very interested in a video that further explains how this magic box called malloc works behind the scenes. How does it find memory to give you? How expensive is it to call it and what are some good practices? Does memory fragmentation affect it at all?

  • @pranavrawal9033
    @pranavrawal9033 ปีที่แล้ว +4

    Perfectly explained everything, an absolute perfection you have in your videos mam.

  • @bhagyashripatil586
    @bhagyashripatil586 2 ปีที่แล้ว +21

    Mam I love ur lecture due to u I can write program and also understand program

  • @RamakrishnaPrince
    @RamakrishnaPrince 2 ปีที่แล้ว +5

    reacently watched "c" videos way of teaching excellant lot of knowledge is their in your videos ☺, as early as possible can you start java.thank you mam,yours loving student😘

  • @johnabednego6728
    @johnabednego6728 2 ปีที่แล้ว +3

    Whaooo, cannot stop watching your lecture! Thanks very much ☺

  • @cosminboglis5160
    @cosminboglis5160 ปีที่แล้ว +3

    Thank you very much! Such great videos!

  • @tiago.c
    @tiago.c ปีที่แล้ว +5

    I'm watching another C course besides Jenny, both are amazing, but everytime I get confused there I come here and find the information missing that I was asking for in the other course. Anyway, no course is able to cover every aspect of a subject, so they are complementary, and Jenny is always great on explaning, thank you so much!

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

      Which other one did you watch? (If you don't mind me asking)

    • @tiago.c
      @tiago.c หลายเดือนก่อน

      @@erinsumner1550 Portpholio Courses

  • @AnuragRawat01
    @AnuragRawat01 ปีที่แล้ว +11

    Real life example:-
    Static memory allocation:- having wallet so that we can pay currency notes whenever we need , for that we need to keep as much money inside wallet as expected no matter it'll be used or not.
    Dynamic memory allocation :- rather than having a wallet to pay money, we can keep Google pay or Paytm on our mobile so that we can pay money as per the need there will be no tention to keep currency notes
    Hope u guys can relate with it😅😅

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

      not that appropriate example according to me

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

      @@lokesh6828 sad to know
      My bad😢😢

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

      @@AnuragRawat01 I have modified you example, maybe that is more appropriate

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

      @@AnuragRawat01
      The real life example can be
      Static memory allocation : Having Rs 10000 from which you can purchase anything but you cannot resell it.
      dynamic memory allocation: having Rs 100000 from which you can rent anything around you and when to return the rented item, you will get full refund and you can use it again and again.

  • @merveilleskatumba2886
    @merveilleskatumba2886 ปีที่แล้ว +2

    Thank you , your videos are amazing ....I am loving C

  • @antoniomike2972
    @antoniomike2972 2 ปีที่แล้ว +1

    Though your English is a bit hard to listen to, I get familiar with it while turning on the caption. Actually, I'm learning another paid course, but I must watch your lessons because they're very easy to understand, they're helping me to figure out what is really under the hood.

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

    Madam please provide video lecture on dynamically allocated structure concept
    what ever you are teaching is very useful and informative thanks for the concern.

  • @sanjays7255
    @sanjays7255 2 ปีที่แล้ว +5

    Extraordinary teaching ma'am 🔥🔥🔥

  • @ambika1.5m78
    @ambika1.5m78 2 ปีที่แล้ว +22

    Ma'am plz upload the vedio. That how can we use maloc( ) ,in structure 🙏🙏🙏
    It's my heartly request ma'am

  • @parisa9374
    @parisa9374 2 ปีที่แล้ว +20

    May you please give an example of malloc() for structure as you suggested in this video? Thank you very much!

  • @vijayjeee8806
    @vijayjeee8806 2 ปีที่แล้ว +8

    Thank u mam for doing vedios on c it helping a lot i recommend so many students on my college and you make it c as easy😊😊

  • @eutychuskurria7765
    @eutychuskurria7765 ปีที่แล้ว

    Huge fun and a follower you have a mentor in c language i just get trouble in understanding your language when you shift from English to ..... leaving me hanging . But you are be best

  • @UdaykumarKUday-yd9ut
    @UdaykumarKUday-yd9ut ปีที่แล้ว +5

    I didn't understand chapati concept madam, because I don't know hindi. But I understand what you are going to teach.😉😉

  • @bitsforbits6581
    @bitsforbits6581 ปีที่แล้ว

    even sandeep jain couldnt make me understand dma...but you did it ma'am...

  • @rahulannarayan
    @rahulannarayan 2 ปีที่แล้ว +4

    I like your dynamic chapati allocation example....can relate to it

  • @Prince_D_Coder
    @Prince_D_Coder ปีที่แล้ว +1

    Your videos are really helpful

  • @zaidumar1174
    @zaidumar1174 2 ปีที่แล้ว +3

    Hello, mam can you make a video on matrix chain multiplication, regarding dynamic programming please!!
    With regards... From me
    Thank you 😊

  • @codemyway69
    @codemyway69 2 ปีที่แล้ว

    It feels very lovely when i listen uh speaking hindi🥰🥰🥰

  • @haider__khan4567
    @haider__khan4567 2 ปีที่แล้ว

    I like you, your teaching style.

  • @pavanipyna3797
    @pavanipyna3797 2 ปีที่แล้ว +9

    mam please upload a video on malloc function using structure

  • @divyanshbalodhi5642
    @divyanshbalodhi5642 2 ปีที่แล้ว +3

    Very good explanation 👍

  • @indianshort1669
    @indianshort1669 2 ปีที่แล้ว

    Mam your teaching style is as beautiful as you 🙏🙏🙏

  • @saidurgaaravindsurisetti8406
    @saidurgaaravindsurisetti8406 2 ปีที่แล้ว +1

    Tq mam for u work for us

  • @sharuk98ala
    @sharuk98ala 2 ปีที่แล้ว

    You are Gorgeous, One of Gods great creations.♥️

  • @bipinkadayat
    @bipinkadayat 2 ปีที่แล้ว +4

    Thank you so much man🙏🤍
    Please Mam make a video
    Display the names in alphabetical order🤍

  • @ArjunSingh-wr3jk
    @ArjunSingh-wr3jk ปีที่แล้ว

    If we want to creat a pointer normally then we can write int*ptr=&any variable this things int* ptr=variable

  • @motivationalblogrameshpaul3005
    @motivationalblogrameshpaul3005 ปีที่แล้ว

    Love teaching 🎈❤️

  • @ajaykumarharijan9734
    @ajaykumarharijan9734 ปีที่แล้ว

    Mam I liked your teaching way as well as your hair style 🥰

  • @sakinasicora2231
    @sakinasicora2231 2 ปีที่แล้ว +1

    Just a genuine question, do you take personal tutions of students, I do understand your course, but sometimes I've got program questions which are difficult to understand 😅

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

    Thank you so much lovely ma'am ❤😊

  • @richtrader9526
    @richtrader9526 2 ปีที่แล้ว +1

    Beautiful

  • @sanjays7255
    @sanjays7255 ปีที่แล้ว +1

    Mam here I have a doubt,we can also reduce the memory waste using"" variable length array concept ""mam.then why we want to use malloc for reduce memory waste

  • @sridharreddy9742
    @sridharreddy9742 2 ปีที่แล้ว

    great explanation

  • @crazysoul6987
    @crazysoul6987 ปีที่แล้ว +1

    Amazing Explanation 🍓🌚🙊

  • @anandsonar7590
    @anandsonar7590 ปีที่แล้ว

    Thank you mam for this video
    can you please explain in program of malloc how the pointer returns null
    please????

  • @baahbernard4183
    @baahbernard4183 ปีที่แล้ว

    You are so good ma'am 🤩

  • @user-ud4cu1rn6q
    @user-ud4cu1rn6q 2 ปีที่แล้ว

    Good explanation
    Superrr sis...

  • @vamsimathi1630
    @vamsimathi1630 ปีที่แล้ว

    Nice explanation..

  • @anuj9615
    @anuj9615 ปีที่แล้ว

    I'm die hard fan of you ❤️
    Love you from NEPAL 😙

  • @jstar2135
    @jstar2135 2 ปีที่แล้ว

    Thank You Mam.

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

    THANKS 👍👍

  • @vattianil2159
    @vattianil2159 2 ปีที่แล้ว +2

    Amazing teaching 👏 mamm

  • @harshitpal5558
    @harshitpal5558 2 ปีที่แล้ว

    Mam after allocating 8 bytes if we need more memory like we need to expand that existing memory block then how we can do that

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

    amazing lecture mam

  • @codewithbishal895
    @codewithbishal895 2 ปีที่แล้ว +1

    god level teaching

  • @Education..29071
    @Education..29071 2 ปีที่แล้ว

    You are beauty with brain 😊😊😊😊😍

  • @bhaskarnaik5842
    @bhaskarnaik5842 2 ปีที่แล้ว

    I became fan of your beauty ❣️

  • @aswinkumarraj5054
    @aswinkumarraj5054 2 ปีที่แล้ว

    I have just entered values with Upto n+5 (in for loop, like i

  • @prereloluwa
    @prereloluwa ปีที่แล้ว +2

    Thnak you for the explicit exposition
    You are fantastic.
    At 22:18 I had some confusions. I thing you spoke your dialect. 👍

    • @amangupta257
      @amangupta257 ปีที่แล้ว

      You can Google it brother

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

      she was explaning the logic of Dynamic memory allocation and its importance of a their food Chappathi.
      if you request your friend to bring you chappathi delivered @ your home since you are not sure how much hunger you are in, your friend might possiblly bring more number of chappathi (for eg:) 5 but you may eat just 2 or 3 and rest is a waste which is a example of Static memory.
      Where as if you go to a canteen or a restraunt and get the food according to your need and there is no wastage which is the example of Dynamic memory.

  • @roshnimandarapu5097
    @roshnimandarapu5097 2 ปีที่แล้ว

    why should we have to type cast, when generic pointer can take any type of pointer right?

  • @jayasuriya9285
    @jayasuriya9285 2 ปีที่แล้ว +1

    a[n] , where 'n' is the number of integer data that user wanted to add. Now no memory is wasted right??. Is it now static??

  • @suchind7558
    @suchind7558 2 ปีที่แล้ว

    Mam op teaching i like ur lecture

  • @engr.talhaahmed161
    @engr.talhaahmed161 ปีที่แล้ว

    i always want to learn about dma concept but dint understand before much , love the way she teaches and it clear all my memory concepts, thank you so much for the video, keep up the good work ma'am

    • @JennyslecturesCSIT
      @JennyslecturesCSIT  ปีที่แล้ว

      Happy to hear that!

    • @RiteshKumar-pu3gp
      @RiteshKumar-pu3gp ปีที่แล้ว

      @@JennyslecturesCSIT mam I want to learn c++ language and I covered till DMA so will it be easy to learn or it is entirely different

  • @dr.balaraju.j.7868
    @dr.balaraju.j.7868 ปีที่แล้ว

    madam great explanation

  • @jecodedoncjesuis875
    @jecodedoncjesuis875 2 ปีที่แล้ว +1

    Please Mam, as soon as you speak your language, we lose your explanations.
    Your explanations are so valuable that we don't want to miss a word of what you say.
    Remember that people follow you all over the world; United States, Europe, Africa..

    • @plumSlayer
      @plumSlayer ปีที่แล้ว

      I'm really sorry for the inconvenience, a temporary soluiion could be, pls mention the time over here and ig someone kind enough could explain the part spoken in Hindi Language....

  • @akhilmittal3283
    @akhilmittal3283 2 ปีที่แล้ว +1

    thanks mam u looking superb mam

  • @sujithsenthilraj6798
    @sujithsenthilraj6798 ปีที่แล้ว

    In that y we are using int* at first of malloc (time:10:46) y we can't use int alone

  • @pendhotaabhinav1316
    @pendhotaabhinav1316 2 ปีที่แล้ว

    mam please can you explain about pratt algorithms please

  • @allmix608
    @allmix608 2 ปีที่แล้ว +1

    Mam u r looking good in this red colour

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

    Love from Andhra Pradesh 😊😊

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

    pls can you also do a video on big O notation

  • @manojm2099
    @manojm2099 ปีที่แล้ว

    But we can achieve the same thing by the below method also right?
    int n;
    scanf("%d",&n);
    int arr[n];

  • @Lyrics_songs.69
    @Lyrics_songs.69 ปีที่แล้ว

    I love you ❤️😂
    This is my first class

  • @dhadhiudayreddy3620
    @dhadhiudayreddy3620 ปีที่แล้ว

    Beauty with brain❤️

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

    Thanks mam

  • @sureshkalesh8402
    @sureshkalesh8402 2 ปีที่แล้ว

    Very beautiful😍❤❤❤❤❤✨✨😍😍

  • @priya-we2hg
    @priya-we2hg 2 ปีที่แล้ว +1

    Good evening mam🙏🙏🙏💐💞❤

  • @Homelessbillionaire
    @Homelessbillionaire 2 ปีที่แล้ว +2

    Success comes from having dreams that are bigger than your fears.
    Bobby Unser

  • @muhammedilliyas7261
    @muhammedilliyas7261 2 ปีที่แล้ว

    Mam, are you conducting Python & Django course. Please let me know. Thanks

  • @Mr.....V228
    @Mr.....V228 ปีที่แล้ว +1

    After free(ptr) when I printing the values the values are being printed, But after free(ptr) the values should not be printed na... Why Is this happening May I know where did I did the mistake...

  • @dharmabhai5728
    @dharmabhai5728 2 ปีที่แล้ว +1

    Super timeing edi matram

  • @unknownindian2142
    @unknownindian2142 2 ปีที่แล้ว

    Frankly speaking I love you mam❤️😅

  • @jaatjaat879
    @jaatjaat879 ปีที่แล้ว

    Thnku jii

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

    Hi mam, i am confusing with (ptr+i) can you explain this?

  • @preetamkumar8128
    @preetamkumar8128 ปีที่แล้ว

    Mam can you upload a video for malloc using structure

  • @anveenm1740
    @anveenm1740 2 ปีที่แล้ว

    You are so beautiful ❤️❤️❤️
    I forget everything every time when I look at you watching you videos of lectures...
    Your Name ? please ....

  • @balakrishnan1859
    @balakrishnan1859 ปีที่แล้ว

    Static memory : Live cricket match (we can't watch the match before or after)
    Dynamic memory:We will watch the match Highlights whenever you want

  • @depanshusharma3113
    @depanshusharma3113 ปีที่แล้ว

    Which one is better
    p is pointer and i is in loop
    Scanf(“%d”,&p[i])
    Or
    Scanf(“%d”,(p+i))

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

      I think the 1st one....its more comfortable... Bt is it correct in this case?

  • @TekSandeep
    @TekSandeep 2 ปีที่แล้ว

    Engineering Teaching madams are good.....

  • @Sandeep-sh7uc
    @Sandeep-sh7uc ปีที่แล้ว

    Mam but pointer variable is used to store only address but why are you using point er variable to store DMA

  • @naninani7109
    @naninani7109 2 ปีที่แล้ว

    Mam did you done videos on jawa

  • @vanajacreations2.741
    @vanajacreations2.741 2 ปีที่แล้ว +8

    The video will be started at 2:29 you can thank me later

  • @msvpraveenpallapothu1720
    @msvpraveenpallapothu1720 2 ปีที่แล้ว +1

    Please reply still how many videos are there to complete c programming language

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

    How is array and structure different?

  • @GajulaSaikumar-ju7rl
    @GajulaSaikumar-ju7rl ปีที่แล้ว

    Why can't we use
    Int n;
    Scanf("%d",&n);
    Int a[n]
    It is also working
    We are giving input at runtime

  • @usersno
    @usersno 2 ปีที่แล้ว

    maam ..please post priority queue...algorithm also😭😭😭

  • @sai3099
    @sai3099 2 ปีที่แล้ว

    Mam please do live lectures

  • @sambasivagali9966
    @sambasivagali9966 ปีที่แล้ว

    ma'am your lookning gorgeous and your lecture too

  • @kishoretadepalli8422
    @kishoretadepalli8422 ปีที่แล้ว

    ma'am can you some question related to thi topic please

  • @tamilpandian5076
    @tamilpandian5076 ปีที่แล้ว

    Why didn't you use the void pointer mam ?

  • @527_nikhil2
    @527_nikhil2 2 ปีที่แล้ว

    Mam ur looking very gorgeous 😍❤️

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

    In "programming in c" playlist, this is the first video with 1080p quality. But of no use because ma'am looks prettier even in 144p quality😅