Тёмный

12. Stack & Heap | C++ Placement Course 

Apna College
Подписаться 6 млн
Просмотров 375 тыс.
50% 1

Notes of this video :drive.google.com/file/d/1Vk-K...
Instagram: / apnikaksha

Опубликовано:

 

9 ноя 2020

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 338   
@yashsharma6112
@yashsharma6112 2 года назад
Thank you literally thank you so much ma'am for introducing me with the concept of dangling pointer. I was googling from 1 hour that " although I have free the memory from heap but the pointer is still storing the address of that memory block. Why is it so ? " And 1 hour later..... I came across your video which helped me alot literally a lot. Thank you again and again.
@MubarikKhan-gy1ri
@MubarikKhan-gy1ri 2 года назад
Basically in your program there are 3 components code, stack, heap. The programming language code is complied by a compiler to machine code. The code can aceess variable directly from the stack but the function such as delete will be allocated in the heap. The heap has a pointer in the stack so the stack can be the median where the code can access the heaps memory. Stack has static(size) memory allocation while heap has dynamic(size) memory allocation.
@whyfactorial0is168
@whyfactorial0is168 2 года назад
All wrong information
@bshsjshejejve8297
@bshsjshejejve8297 2 года назад
​@@whyfactorial0is168 then tell the correct info if you know any better?
@reyazmra
@reyazmra 3 года назад
Just now i thought to watch a video of stack and u uploded 🥳🥳🥳
@shubhamkale735
@shubhamkale735 3 года назад
Thank you Aman sir and whole team for this course
@abhishekdutt3601
@abhishekdutt3601 3 года назад
Kudos to the graphic designer/animator. Very nicely explained.
@pannerbiryani3002
@pannerbiryani3002 Месяц назад
this is so true
@RoshanSingh-ce2qm
@RoshanSingh-ce2qm 3 года назад
Wow, what a crystal clear explanation.....
@pawanpanchal5602
@pawanpanchal5602 3 года назад
Priceless content... Plz upload more
@Bhimkishakti88
@Bhimkishakti88 3 года назад
Class 12 student just came here to like ... Huge respect for teachers
@abhisheknishad2401
@abhisheknishad2401 3 года назад
Avvaj sunne ate h😂😂
@Bhimkishakti88
@Bhimkishakti88 3 года назад
@@abhisheknishad2401 ha vai... 😂😂
@dontsubscribetomychannel8619
@dontsubscribetomychannel8619 3 года назад
I am class 9 student following their course Huge respect for Aman Bhaiya
@yourbestie4138
@yourbestie4138 3 года назад
bro just dont like and leave without watching full video bcoz the average view duration of video will decrease and it will be an negative impact on the channel.....🙂🙂as youtube doesnt consider number of likes it only counts average view duration😉
@anudeep0129
@anudeep0129 3 года назад
me too 7th grade
@prodiptushar6680
@prodiptushar6680 3 года назад
thank you sir for this great tutorial.it is very helpful
@Incredible_rahul_01
@Incredible_rahul_01 Год назад
Seriously very helpful for students thank you @apna collage ❤
@PANKAJKUMAR-fe8zn
@PANKAJKUMAR-fe8zn 3 года назад
The practice questions of notes links and previous notes links are also not working. Please rectify it bhaiya and thank you very much for such high quality content.
@samarthtandale9121
@samarthtandale9121 2 года назад
Awesome Explanation 🤩 !!!
@rahulkumar-cy8xi
@rahulkumar-cy8xi 3 года назад
very well explained through the diagram
@rohitchitte5614
@rohitchitte5614 2 года назад
This course is boon ! for those who take it seriously. great content boss ! good work and thanks a lot .
@shubhamdeswal
@shubhamdeswal Год назад
Code is here: #include using namespace std; int main(){ int a = 1; // stored in stack int* p = new int(); // allocate memory in heap *p = 1; // 'p' is a pointer that is stored in stack but the value is stored in heap delete(p); // deallocate mmemory in heap but 'p' still uses bytes in stack p = new int[4]; // 'p' can be reused delete[] p; //delete array p = NULL; // delete pointer value return 0; }
@sahilsawal
@sahilsawal 3 года назад
Thank You Ma'am 😇👏👌🙏👍
@sankhajitpal1050
@sankhajitpal1050 3 года назад
Just the best elder brother..
@divyanshujod
@divyanshujod 3 года назад
Greatest man in the world ever lived in the universe " Aman Dhattarwal"
@nishant3859
@nishant3859 3 года назад
correct bro........
@MO-fg2cm
@MO-fg2cm 3 года назад
Bhot saare logo ne free courses nikala hai ... And better than AD also
@BackToBoi
@BackToBoi 3 года назад
@@MO-fg2cm please tell anyone that is better then AD I want to join
@arjun4627
@arjun4627 Год назад
@@BackToBoi nareshitshah
@theprince4680
@theprince4680 День назад
I was frustrated with using the new operator without knowing the concept but this video was really helpful to understand it.
@amansinghgautam9189
@amansinghgautam9189 3 года назад
Bhiya timetable ke hisaab se kuch topics miss ho gye h... Stack and heap ke pehle bhi kuch topic the... Aur pointer bhi kaafi vast topic h... Please take a look.. And thnx for your team aman bhiya your team is doing a great job🙂🙂
@lifeoeshita
@lifeoeshita 3 года назад
I think when bhaiya's team starts Linked List then they explore the pointer's other topics.
@satyamtripathi888
@satyamtripathi888 3 года назад
timetable hai to bhej de bhai
@shodhandevadiga906
@shodhandevadiga906 3 года назад
Practice question link not opening
@preritgoyal6506
@preritgoyal6506 2 года назад
Can you send the whole cpp topic list which is missing and topics list of dsa also
@rameshmalhotra9525
@rameshmalhotra9525 2 года назад
ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-QTaiF8N6i3Y.html
@raashikajajoo
@raashikajajoo 3 года назад
Watching a yt video in normal speed after so long 😂 Thank you so much for this course 👏
@abhinavkashyap2196
@abhinavkashyap2196 3 года назад
once you start watching videos at 1.5x or 2x there's no going back😂
@swastikkumarpal7795
@swastikkumarpal7795 2 года назад
muhh ki baat 6inli
@simplesolutions2621
@simplesolutions2621 3 года назад
Very good explanation!
@TJVideos
@TJVideos 3 года назад
Very well explained!!
@rutvikrana512
@rutvikrana512 3 года назад
Excellent explanation 👌
@madhavanand756
@madhavanand756 3 года назад
❗ Notes - Question Link Not Working ❗ Please Reply or Update
@adityarajcp
@adityarajcp 3 года назад
It's working
@madhavanand756
@madhavanand756 3 года назад
@@adityarajcp Nops dude I tried on both, mobile and computer. How are you able to open ? Why not to share links here.
@navjotsingh5240
@navjotsingh5240 3 года назад
@@adityarajcp It's not working
@srijandas7196
@srijandas7196 3 года назад
Mera nahi ho raha hai. Tumhara kayse hua??
@avieroopghosh2526
@avieroopghosh2526 3 года назад
Not working yet
@abhaytiwari6411
@abhaytiwari6411 3 года назад
Heartfelt congratulations to you
@prajjavalsrivastsva7037
@prajjavalsrivastsva7037 3 года назад
This concept is worth for LINKED LIST
@GauravChaudharyNITW0501
@GauravChaudharyNITW0501 2 года назад
Thanks didi for this video 🙏🏻
@mikansenpai2280
@mikansenpai2280 3 года назад
Don't deallocate too soon Only deallocate memory when you are truly finished with that memory. If you have more than one pointer to a chunk of memory, then deallocating that chunk makes all pointers to it stale; they are pointing to memory that you are no longer allowed to use. Those pointers are called dangling pointers. Watch out: no automatic deallocation in the heap Some languages, such as Java, use garbage collectors that periodically go through the heap and recycle chunks of memory that are not being used. That does not happen in a C++ program. If you lose all pointers to a chunk of memory without deallocating that memory then you have a memory leak. Your program will continue to own that memory, but has no way of ever using it again. A very small memory leak is not a problem. But if a program allocates a lot of memory and never deallocates it, the program's memory footprint will grow and grow. When your program stops, all of the memory that it owns is automatically recovered by the operating system. So a memory leak is only relevant while a program is running; it does not affect the system after the program stops.
@sudhanshunain4690
@sudhanshunain4690 Год назад
Thank you so much.
@shreyaschavhan5522
@shreyaschavhan5522 3 года назад
Stack & Heap: Stack - 0:35 Stack Overflow - 2:10 Heap - 3:18
@anshulmalokar9748
@anshulmalokar9748 3 года назад
Nice revision session .!!!
@yashsimra6090
@yashsimra6090 3 года назад
your videos are amazing ,it is really helping me allot ,now i can do coding,because i can think of some approach ,you people taught us how to think in coding,big thanks from my end
@SUJOYPAULJOBS
@SUJOYPAULJOBS 3 года назад
whatsapp mam ..nice learning mam you are goog teacher c++
@uttamkarmakarece3534
@uttamkarmakarece3534 3 года назад
This college doing great 👌👏
@amandwivedi2302
@amandwivedi2302 3 года назад
Ye didi ne best padhya hai👏👏🙏🏻
@avinashgupta2308
@avinashgupta2308 3 года назад
Aman bhaiya no doubt super hero 💜 but urvi didi , rishab bhaiya jitna pyaar doon utna kam parega luv from kolkata
@bpratikvinod8110
@bpratikvinod8110 2 года назад
I like this topic !
@shubhamkalravevo1884
@shubhamkalravevo1884 2 года назад
The voice is so engaging.
@AbhishekKumar-td5zu
@AbhishekKumar-td5zu 3 года назад
Tqsm bhaiya ♥️♥️
@Anonymous-qe3yg
@Anonymous-qe3yg 3 года назад
Are the practice questions mentioned in the end of the notes pdf not meant to be some links?? Because they are highlighted blue and underlined but they are just text only and there is no link attached to them and basically seem like dangling pointers. Lol
@anishasodani3279
@anishasodani3279 6 месяцев назад
yes true
@ajaykiran6
@ajaykiran6 3 года назад
Dhannyavaad.
@bhargav1534
@bhargav1534 3 года назад
I can't understand please recommend other video
@kamalkumar7133
@kamalkumar7133 3 года назад
its hard to understand at first watch it twice
@karimi3963
@karimi3963 3 года назад
@@kxb6098 ankit tharan wala???
@tanmayasamaltk64
@tanmayasamaltk64 3 года назад
Try to watch the video 2-3 times 👆
@venkateshwarrao5321
@venkateshwarrao5321 3 года назад
@@kxb6098 thankyou so much for the info !
@venkateshwarrao5321
@venkateshwarrao5321 3 года назад
@@kxb6098 can u please provide the instructors name ?
@sarathi1638
@sarathi1638 3 года назад
Good explanation
@anurag_goel6232
@anurag_goel6232 3 года назад
At last after deleting in the array block then why in stack value of p is 400?
@niitteenpathak8303
@niitteenpathak8303 3 года назад
Thank you didi❤❤
@arjun_dev_guru
@arjun_dev_guru 2 года назад
Your voice is awesome
@subhajitsengupta165
@subhajitsengupta165 3 года назад
didi tumi khub bhalo porao thank you
@himanshuprem600
@himanshuprem600 3 года назад
thank you....
@shubhambhardwaj8894
@shubhambhardwaj8894 3 года назад
Awesome👍
@madhavanand756
@madhavanand756 3 года назад
❗ Error or Doubt ❗ 1:06 Can num1 and num2 be accessed from main from function ? No Can a, b, sum be accessed from add function ? -No- Yes, with help of pointers
@dontsubscribetomychannel8619
@dontsubscribetomychannel8619 3 года назад
Madhav 355 yes you can access with pointers or by making a global variable of it But not directly
@sisirpynda5875
@sisirpynda5875 3 года назад
i had the same doubt ... that way any variable is a global variable na?.......it can also be the case that as stack memory is not permanent and can be popped its not good to take it as a global variable declaration space.
@rishabhgupta9439
@rishabhgupta9439 3 года назад
sir the link in the last of the notes not working. Please upload it again.
@binu44464
@binu44464 3 года назад
❤️
@nikhilmehra613
@nikhilmehra613 3 года назад
Her voice❤️
@alisaheebtinwala1998
@alisaheebtinwala1998 2 года назад
What's the point of storing a variable in heap of its pointer gets stored in stack? We are anyway using the stack memory when storing the pointer. How does it help with the code?
@sagarjain4128
@sagarjain4128 2 года назад
maybe we are doing so because now as we are just storing the pointer or address in stack then we are using very less space in stack and actual thing that we want to store is in heap! This way we are saving the memory of the stack which is Limited.
@Radaradababurao
@Radaradababurao 3 года назад
Urvi di teach more clear and best way
@mohakgidwani1505
@mohakgidwani1505 3 года назад
The links are not working in this pdf as well as the one's in the previous videos. Can you please rectify this issue !
@_rahulsain
@_rahulsain 3 года назад
added question link for this and previous lecture on my github : github.com/rahulsain3000/CPP-DSA/blob/master/resources.txt other are in lecture 14 in phase 1 folder check out
@shashankgaur3917
@shashankgaur3917 3 года назад
@@_rahulsain Hello sir can you please tell how to make Mega.nz downloader which can work without Vpn , Cause the ones i found on github are not working properly, Also the Mega Downloader doesn't works.
@snehilsinha4689
@snehilsinha4689 3 года назад
@@_rahulsain But this link has questions in C. Where to practice the C++ questions from ? Pointers can still be done from C one but DMA has completely different format in both the languages.
@_rahulsain
@_rahulsain 3 года назад
@@snehilsinha4689 oh i will update the links
@snehilsinha4689
@snehilsinha4689 3 года назад
@@_rahulsain yeah please do. It would be very helpful 🙏
@hustler212
@hustler212 2 года назад
What does it mean to change the memory at run time/ dynamically?
@noman_47
@noman_47 Год назад
Stack - 0:35 Stack Overflow - 2:10 Heap - 3:18
@uttamkarmakarece3534
@uttamkarmakarece3534 3 года назад
Please show some programming on stack & heap concept
@vatsalyaa.m
@vatsalyaa.m Год назад
When we deleted the array created in heap using delete[]p; And then assigned NULL to pointer p , So shouldn't the value of p become zero ? It is still 400. (Maybe you forget to do so or whether i am wrong, pls correct me)
@pranjalbajpai156
@pranjalbajpai156 3 года назад
very nice lecture
@medipakpagare
@medipakpagare 3 года назад
Best video's
@rutvikrana512
@rutvikrana512 3 года назад
Is memory auto cleared if we have memory leak and program ends ?
@rupendarkumar8498
@rupendarkumar8498 Год назад
Thanks 👍
@saurabhchamoli5204
@saurabhchamoli5204 11 месяцев назад
How can array be stored in heap. In heap dynamically memory is allocated but array has fixed size which is initialize statically
@raashikajajoo
@raashikajajoo 3 года назад
Suggestion: You can add subtitles so that more people can reach out
@StoryGicRohit
@StoryGicRohit 3 года назад
shukriya
@omwagh3314
@omwagh3314 3 года назад
Thanks bhaiya for your support You are giving us the best classes
@aniruddhmishra6182
@aniruddhmishra6182 3 года назад
🔥
@murarichaudhary5602
@murarichaudhary5602 Год назад
op ;)
@sandip_kanzariya8476
@sandip_kanzariya8476 2 года назад
nice explanation sister
@musicstand997
@musicstand997 3 года назад
It's follow LIFO rule last in first out
@ritikshrivastava9442
@ritikshrivastava9442 3 года назад
the notes you provided and in that the practice question is not clicking i mean it is not dereferencing
@algotarrohit9191
@algotarrohit9191 3 года назад
❤️❤️❤️❤️
@sumitworld918
@sumitworld918 Год назад
👏👏
@kaushanighosh5133
@kaushanighosh5133 2 года назад
can anyone please tell how to open the hyperlinks of the notes?
@coding_dunes
@coding_dunes Год назад
mem is aavaj kitni pyari h💌
@raihanmdsiqbal9097
@raihanmdsiqbal9097 3 года назад
Bhaiya merge sort and quick sort ki video kab aaaegi? Strings bhi missing hai. Aur practice questions ka link mai access nahi kar paa raha huun
@syedzairhussain3620
@syedzairhussain3620 3 года назад
Bohat alaw
@ripusudanchourey9063
@ripusudanchourey9063 3 года назад
THnks AMaN bHaiYa aNd Team
@gureshabajaj6266
@gureshabajaj6266 3 года назад
Bhaiya, Course ki timeline ke hisaab se strings ke topics miss hogye h, and pointers bhi kaafi vast topic hai, jitna aapne padhaya h uske alawa bhi pointers me kaafi kuch hai, please bhaiya please vo sab bbi sikha dijiye
@sahajpatel2749
@sahajpatel2749 3 года назад
The lectures are good but don't know why the links are not accessible in the lecture notes :\
@siddarthaaggarwal3422
@siddarthaaggarwal3422 3 года назад
bhaiya nsit instrumentation se kya tech companies ki placement mei baith sakte hai?
@narcmusic
@narcmusic 3 года назад
ye wala agr full animatied ho to ache se smjh aate kyuki mere ko nhi aaya ache se
@rachitsharma5289
@rachitsharma5289 3 года назад
Bhaiya stack and heap implementation ki video nhi aayegi kya? Or linked list ki bhi? Please reply🙏❤️
@shashankyadav866
@shashankyadav866 2 года назад
Practice questions link given in the drive are not working.... Please chech.... And thank you for such awesome content 🔥
@devenkhobragade8546
@devenkhobragade8546 3 года назад
CAN Anyone tell me , why the links in pdfs are not working??(IF it is working plz reply with how to access it)
@ayushmansharma1402
@ayushmansharma1402 3 года назад
you have sign in your youtube account for accesing the pdf
@architasrivastava218
@architasrivastava218 Год назад
In stack function why main was called before add function?
@ah.najeemnooran4075
@ah.najeemnooran4075 2 года назад
When we use stack or heap
@sanyamsharma350
@sanyamsharma350 2 года назад
Upar se gya ✈😁
@mohitjoc25
@mohitjoc25 3 года назад
Java python pe bhi aisi series aaygi kya. ...in apna college
@swamynaidu4759
@swamynaidu4759 3 года назад
DOUBT:WHAT IS 3D ARRAY IN PRACTISE PROBLEM INGIVEN NOTES?
@delluser1227
@delluser1227 3 года назад
kya brackets lagana jaruri hai int *p= new int(); mai solo learner pe sikha hu int *p=new int; halaki do run ho rahe hai
@ashishmartin5985
@ashishmartin5985 3 года назад
No brakets jarure hai! syntax for new operator is-new data-type();
@RishabhMazumdar
@RishabhMazumdar 3 года назад
Hello my fellow online classmates can anyone please tell me that the questions given at the end of pdf contain links or are simple texts and if they are links then how to open it???
@arfainsaba6258
@arfainsaba6258 3 года назад
Yes, it's not opening for me too!
@SumitSingh-nr8jt
@SumitSingh-nr8jt 3 года назад
coutn; int arr[n]; like if I do in this manner then is this also a dynamic memory allocation? or by just using new keyword we can achieve it
@waliakbarkhan3473
@waliakbarkhan3473 2 года назад
this is static memory allocation: stack
@manashdas5004
@manashdas5004 3 года назад
what is dynamic programming
@UnKnown-id7ih
@UnKnown-id7ih 3 года назад
Di i think pointers topic is hard and also 1 video is not enough for the pointers.
@ItsYourCandyBro
@ItsYourCandyBro 3 года назад
Anyone reply plz... 1.pointer variable ka size kitna hota 2. At one place she deallocate by typing "delete(p)" and another place"delete[ ]p".So i think these are two different syntax And when we use first and when second
@VinitaClasses
@VinitaClasses 2 года назад
delete(p) we use when we have to deallocate memory of a variable or pointer from heap . delete[ ]p we use when we have to deallocate memory of an array from heap .
@15priyanshupratapsingh24
@15priyanshupratapsingh24 Год назад
for 32 bit Os, it is 4 byte and for 64 bit Os, it is 8 byte
@toyshopenterprises
@toyshopenterprises Год назад
3:50 mere pas to physical memory Hai. Yeh virtual memory Kaise dalte hai
@jangidshweta495
@jangidshweta495 3 года назад
maam, I want to become a website designer.. what should I do now?
Далее