Revisiting Pointers: new and delete Keywords in CPP | C++ Tutorials for Beginners #50

  Рет қаралды 254,812

CodeWithHarry

CodeWithHarry

Күн бұрын

Download the best IDE for C, C# and C++: bit.ly/WholeTo...
►Source Code & Resources: codewithharry....
►This video is a part of my C++ playlist: • C++ Tutorials In Hindi
►Checkout my English channel here: / programmingwithharry
►Click here to subscribe - / @codewithharry
Best Hindi Videos For Learning Programming:
►Learn Python In One Video - • Python Tutorial In Hin...
►Python Complete Course In Hindi - • Python Tutorials For A...
►C Language Complete Course In Hindi -
• C Language Tutorials I...
►JavaScript Complete Course In Hindi -
• JavaScript Tutorials I...
►Learn JavaScript in One Video - • JavaScript Tutorial
►Learn PHP In One Video - • Learn Php In One Video...
►Django Complete Course In Hindi -
• Python Django Tutorial...
►Machine Learning Using Python - • Machine Learning Tutor...
►Creating & Hosting A Website (Tech Blog) Using Python - • [Hindi] Web Developmen...
►Advanced Python Tutorials - • Intermediate/Advanced ...
►Object Oriented Programming In Python - • Object Oriented Progra...
►Python Data Science and Big Data Tutorials - • Python Data Science an...
Follow Me On Social Media
►Website (created using Flask) - www.codewithhar...
►Facebook - / codewithharry
►Instagram - / codewithharry
►Personal Facebook A/c - / geekyharis
Twitter - / haris_is_here

Пікірлер: 277
@GeekyShubhamSharma
@GeekyShubhamSharma 4 жыл бұрын
Pta nhi aisa kyu hota hai mere saath Kahi or se padhu to bhul jata hu lekin jab aap padhate hai to pta nhi kyu hamesha hamesha ke liye yaad rh jata hai🤔🤔 The way u teach is next level no one can teach like this best teacher ever award should be given to u💓💓💓💓💓💓💓💓💓💓💓💓
@InfiniteWonderss
@InfiniteWonderss 2 жыл бұрын
Guys, we are legends because we started to watch these videos 2-3 years ago and now we have completed 50 videos. congratulations to all of you.
@yash_kirnapure4528
@yash_kirnapure4528 2 жыл бұрын
🤝
@gamingwithasmile268
@gamingwithasmile268 Жыл бұрын
🥲
@kumkumbhagya51
@kumkumbhagya51 Жыл бұрын
yes we did it🤝🤝
@kieieiee9343
@kieieiee9343 3 жыл бұрын
finally reached the 50 th video , lets finish this now
@nachiketpushkarna3295
@nachiketpushkarna3295 3 жыл бұрын
yes bro
@Desireanshu
@Desireanshu 4 жыл бұрын
You can also add that if we declare the variable like line 6 --> int a = 4, it will allocate the memory in the stack form. If we declare the variable using 'new' keyword like in line 11 --> int *p = new int(40), it will allocate the memory in heap
@bohotsaaridhop
@bohotsaaridhop 3 жыл бұрын
So we use new and delete for heap memory allocation only?
@sukhmandersingh4306
@sukhmandersingh4306 3 жыл бұрын
@@bohotsaaridhopyes
@dimpleverma1181
@dimpleverma1181 2 жыл бұрын
Yes
@anubhavsharma1326
@anubhavsharma1326 2 жыл бұрын
@@bohotsaaridhop yes
@pratikshapatil213
@pratikshapatil213 4 жыл бұрын
Really wonderful Sir....I have even suggested 3 of my friends to watch ur videos...even they are loving to watch ur videos....
@manavroy7293
@manavroy7293 2 жыл бұрын
6:24 TIP: We could also initialise thier values like that- int *arr=new int[3]{2,4,8}; cout
@shashinegative9366
@shashinegative9366 2 жыл бұрын
kaise socha esa bhai..
@shashinegative9366
@shashinegative9366 2 жыл бұрын
aur bhai last element q nhi delete ho rha
@jesusmelody4643
@jesusmelody4643 2 жыл бұрын
@@shashinegative9366 bhai aapko pta chla kya???
@anonymous_ghost_123
@anonymous_ghost_123 Жыл бұрын
bhaiya agar aap nhi hote toh pata nhi mera kya hota aapka ye course and dsa wala course is helping me a lot... thanx for providing this for free...
@atgamingstudios6445
@atgamingstudios6445 4 жыл бұрын
Thank you bro ❤️ mai aapke saare C++ ke tutorials follow kr rha hu Since April and merko C# ke course ka be sabri se intazaar hai kyuki mai Unity me programming krna chahta hu
@tayyabsami258
@tayyabsami258 Жыл бұрын
Alhamdulilah reached half century of the vedio of this playlist .Thanks a lot😍
@Rehan-fz3vt
@Rehan-fz3vt 2 ай бұрын
yeppp
@nnasirhussain
@nnasirhussain 3 жыл бұрын
****Remember*** only dynamically allocated variables can be destroyed using delete operator
@nakularora9319
@nakularora9319 2 жыл бұрын
@Hamza bhai playlist me to 74 videos hi hain apne konsi 75 video deh li
@pavannagaraju508
@pavannagaraju508 Жыл бұрын
@Hamza Kaise ho beta tum aur tere ma
@sauravmandal5
@sauravmandal5 2 жыл бұрын
5:20- Bhaiya as you said , the value is allocated dynamically , so doesn't we need to free the memory , like you have teached us at mallock / calloc (), - may leads to memory leak.
@deepakkaushik1639
@deepakkaushik1639 4 жыл бұрын
Harry brother kindly make more videos on this cource . If other also want kindly like this . 👍👍👍
@SonuSharma-mh1wr
@SonuSharma-mh1wr 4 жыл бұрын
Yes I also want more on c++
@RankersBseb
@RankersBseb 4 жыл бұрын
kzbin.info/www/bejne/iJ2sY2SqaNp3irs IIT jee notes
@meb1376
@meb1376 3 жыл бұрын
Has the c++ course been completed in the whole 74 videos or are some portions still left??KKindly help me in knowing this
@weirdotic6885
@weirdotic6885 4 жыл бұрын
Harry bhai please aap kya unity ka tutorials shuru kar sakte hai. Bauhat achha hoga bhai. I appreciate your hardworking. Thank you!
@vishusaini7587
@vishusaini7587 Жыл бұрын
This is the best C++ course I ever came across. Just one thing, would have been really good if you would also have talked about memory allocation in C++ (i.e stack and heap concept) at this point. They have always confused me a lot. Thanks and my best wishes to you.
@LiTtLeGyAnBySubhash
@LiTtLeGyAnBySubhash 4 жыл бұрын
Aapki C language tutorial ki video mere bohot kaam aa rhi h Thanks 😊 Pr *JAVA* ka tutorial nhi mil rha h
@atgamingstudios6445
@atgamingstudios6445 4 жыл бұрын
Check playlist learn in one video
@nahushdeshmukh9375
@nahushdeshmukh9375 Жыл бұрын
Most advanced channel for coding on desi language❤
@darshanagrawal5502
@darshanagrawal5502 4 жыл бұрын
Thank u Harry bhai aapke wjese he mere topic clear ho gye jo kbhi socha nhi tha m kr pauga best teacher ❤️👍keep it up
@gayatribelhekar9054
@gayatribelhekar9054 3 жыл бұрын
Your hard work is really appreciable. Keep Going Harry ! people like you are real gems of KZbin !!
@shiv_ops
@shiv_ops 4 жыл бұрын
Sir, please make a playlist on Python Data Structures and Algorithms.
@opmemes2392
@opmemes2392 3 жыл бұрын
Python me nahi hoga😀😀😀😀😀
@HarjotSingh-rj2lf
@HarjotSingh-rj2lf 3 жыл бұрын
@@opmemes2392 We can use any language for data structures and algorithms, no matter it is python or any other language
@alejandroelijah1069
@alejandroelijah1069 3 жыл бұрын
sorry to be offtopic but does anybody know a method to get back into an instagram account..? I was dumb lost the login password. I would love any assistance you can offer me!
@sanketnirwane2099
@sanketnirwane2099 3 жыл бұрын
@@alejandroelijah1069 do try all methods like forgot password and all others which r available
@souradeeppathak
@souradeeppathak 2 жыл бұрын
Yeah please
@051-rahulchourasia8
@051-rahulchourasia8 4 жыл бұрын
Strike half-century today ten more left Thank you harry bhaiya
@prabhattiwari007
@prabhattiwari007 2 жыл бұрын
After watching your c++ lectures from 1-50.i must see they're too good.Secondly bhaiya PLAYLIST ACCESS kar liya h ...i assure you ..trust me😂😂
@AmirInsan-ok8wb
@AmirInsan-ok8wb 11 ай бұрын
Harry be like: backchodi mat kr l×××e😂😂
@computerknowledge7183
@computerknowledge7183 10 ай бұрын
😂😂
@mohitsapkal1543
@mohitsapkal1543 3 жыл бұрын
Sir why after deleting arr we get the value of arr[2] correct, also I tried this by re-running the code and also increasing the size of array. Problem is that after 2 elements, all values are correctly shown....pls clear this confusion :)
@AadityaSPatil
@AadityaSPatil 2 жыл бұрын
I wanted to ask the same question!
@sandeepkumartiwari8436
@sandeepkumartiwari8436 2 жыл бұрын
@@AadityaSPatil I also have same problem . If you know the answer please tell me Please.
@shilpijain9339
@shilpijain9339 2 жыл бұрын
I also have the same problem
@shaheenkhan868
@shaheenkhan868 2 жыл бұрын
Elements are not necessarily removed when you delete[] them. They are just made available to the system for re-use. Accessing them afterwards is not allowed (Undefined Behaviour). If your array had held objects with destructors then delete also causes destructors to be run before making the memory available for re-use
@vaibhavshinde5520
@vaibhavshinde5520 2 жыл бұрын
Have you tried delete[ ] are instead of delete arr
@soloh4cker
@soloh4cker 4 жыл бұрын
Humara developer kesa ho... Harry bhai jesa ho!!!
@soloh4cker
@soloh4cker 3 жыл бұрын
@Angelo Jon ohh my god bro...it really works...i hacked USA president's insta account using that...OMG you are the greatest hacker i have ever known...There must be a golden big statue of you in your country...You deserve a really best hacker award....Thank you so much for helping me...Now i am second biggest hacker in the world... bcoz you are first!!!! Thanks again dude
@soloh4cker
@soloh4cker 3 жыл бұрын
@Angelo Jon guess what??? Now i am gonna turn your fake website down with Dos attack bcoz you asked for payment....now save it if you can🙂
@vaibhavmore1051
@vaibhavmore1051 4 жыл бұрын
Sir, Please make a playlist on the meanstack course.
@kumkumbhagya51
@kumkumbhagya51 Жыл бұрын
6:14 kyuki vo ek array hai isliye [ ] ye waale brackets use hai
@ThomasShelby-s1q
@ThomasShelby-s1q 3 ай бұрын
#Note. Normally in c++ memory allocated in stack. but dynamically allocated memory assign in heap.
@SonuSharma-mh1wr
@SonuSharma-mh1wr 4 жыл бұрын
Harry bahi c++ par aur b video ban do . I LIKE IT 👌
@deepakkaushik1639
@deepakkaushik1639 4 жыл бұрын
Yes, we want more on c++
@pavan305
@pavan305 2 жыл бұрын
Finally i've reached half century.... OOPs mai bohot maza aagaya abhi tak.... LOooking forward to complete course ASAP
@zebra-er6xc
@zebra-er6xc 2 жыл бұрын
bhai baki videos mei kitna time laga 50 to 74?
@swostideepnayak5412
@swostideepnayak5412 10 ай бұрын
sir plz make a playlist for dsa in cpp its most demanded
@abuzargour3030
@abuzargour3030 3 ай бұрын
You arr so great 🎉
@darpanPednekar
@darpanPednekar 4 жыл бұрын
Sir please make a playlist on Angular
@HarishKumar-jm5bk
@HarishKumar-jm5bk 4 жыл бұрын
Harry sir please please 🙏 c++ ka data structure bhi krwa dena
@anitaaggarwal6981
@anitaaggarwal6981 4 жыл бұрын
CONGRATULATIONS FOR 402K SUBS Harry BHAI !
@zeno30703
@zeno30703 2 жыл бұрын
He quadrapuled that value in a year. Damn!
@irfanahmad-uy6dx
@irfanahmad-uy6dx 7 ай бұрын
Plz also make a vedio on aggregation and composition plz
@palashsharma891
@palashsharma891 4 жыл бұрын
Bhaiya ek data science pe roadmap ka video banado. Jo apne pseudo Python developer ka bataya tha ek video mein, use thoda aur clearly samjhaiye please.
@devanshsaxena1585
@devanshsaxena1585 3 жыл бұрын
What is difference between delete arr and delete [ ] arr ? Both are freeing the memory block
@sandeepkumartiwari8436
@sandeepkumartiwari8436 2 жыл бұрын
I think their is no difference between delete arr or delete [ ] arr
@SAHIL----10
@SAHIL----10 9 ай бұрын
delete: This is used to free memory allocated with new. It is used for a single object. delete[ ]: This is used to free memory allocated with new[ ]. It is used for arrays.
@miss_surpiya_23
@miss_surpiya_23 4 жыл бұрын
sir app live aa sakte ho.... doubts ke...liye...plzz...🙏🙏🙏
@altamashsabri8142
@altamashsabri8142 4 жыл бұрын
Bestem best Harry bhai💪💪💪
@vedantsayys
@vedantsayys 3 ай бұрын
finally completed 50 lectures !!!
@sonigupta9879
@sonigupta9879 4 жыл бұрын
Sir, please come up with react js tutorial. 🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻
@PrashantKumar-wk1xb
@PrashantKumar-wk1xb 2 жыл бұрын
Thankyou sir for providing us free video
@jainilprajapati9786
@jainilprajapati9786 3 жыл бұрын
Today am GTU's 3rd sem exam of computer and i only refer you videos ❤️.
@kunalshahare9041
@kunalshahare9041 3 жыл бұрын
thanks bhai
@mohitpatel7173
@mohitpatel7173 2 жыл бұрын
When we use delete operator with array. It not delete the last value that store in the array. In your example the value of array[2] wasn't delete when using delete[]arr. Why?
@Stolen__spirit
@Stolen__spirit Жыл бұрын
#everyone i have one doubt why we need dereference operator when we allocate heap memory for an int data type and for array why we don't need dereference operator for retrieving the value? haary bhaiya make a discord group for doubts if possible !!
@mevishalcoder
@mevishalcoder 4 жыл бұрын
Bhai "Java" par kab Playlist bana rahe ho ?
@saadhassan8813
@saadhassan8813 5 ай бұрын
Thanks Dr Harry
@IDK-sk2yj
@IDK-sk2yj 2 жыл бұрын
superb explanation sir.
@abdullah_saeed10
@abdullah_saeed10 Жыл бұрын
yrr pointers ki tou bht mushkil se samajh aa gyi lekin ab ye new aur delete keywords ko smajhne me kaafi time lage ga
@mdrehanfarid2134
@mdrehanfarid2134 3 жыл бұрын
Sir hr language ki important questions kr wa digiye
@royfamily9273
@royfamily9273 2 жыл бұрын
Thanks Harry Bhaiya
@dhruvnation1884
@dhruvnation1884 4 жыл бұрын
Thnx for the helpful tutorial
@miss_surpiya_23
@miss_surpiya_23 4 жыл бұрын
yeh fir..koi or.. Idea doubts clear krne...ke liye🙏🙏
@gauravsrivastava5947
@gauravsrivastava5947 3 жыл бұрын
Sir please make the Roadmap for Software Engineer
@MonikaKumari-er4de
@MonikaKumari-er4de 2 жыл бұрын
Thank you 😊
@harshikasindwani27
@harshikasindwani27 10 ай бұрын
Why we are assigning value to the memory like it should be assigned at the run time na? How can it be dynamic if we are assigning it at compile time? #doubt #IfAnyoneCouldHelp
@hritikworld9944
@hritikworld9944 4 жыл бұрын
Thank you so much for your amazing videos
@shivanshusingh3449
@shivanshusingh3449 4 жыл бұрын
I am using the delete operator as shown in the video to delete a dynamically created array but is only deleting the first two elements of the array. Harry bhai please help.
@crazyduniya128
@crazyduniya128 3 жыл бұрын
yes same confusion
@meharsulaiman7358
@meharsulaiman7358 2 жыл бұрын
06:27 one two three Le mein: Dill ko karar aya tuj py hayee pyaar aya pehli pehli baar aya oh yara 😍😍🤣🤣🤦‍♂🤦‍♂
@muhammadareebkazmi9476
@muhammadareebkazmi9476 2 жыл бұрын
Thank you, Harry bhai!
@dharmik5442
@dharmik5442 3 жыл бұрын
You are my mentor❤
@DK-dp1pt
@DK-dp1pt 2 жыл бұрын
why 3rd array element is not destroyed(arr[2] = 30) ??
@ajaypandey1390
@ajaypandey1390 4 жыл бұрын
Bhai plz plz reply dena Maine physical E. Le liya tha ab mai 12 mai ho aur mujhe code sikhna hai
@deepakmurmu7732
@deepakmurmu7732 Жыл бұрын
hello harry bhai woh jjoh apne delete arr likha he usse sirf arr ke pehle two elements delete hue par last wala nhi hua, kyun?
@MahnoorAkhtar-b4f
@MahnoorAkhtar-b4f 3 ай бұрын
Thanks sir...😊
@kumkumbhagya51
@kumkumbhagya51 Жыл бұрын
3:39 vaise humne isme ptr ki value nikaali kyuki a ki value check krne ke liye hum bas
@NishitRathod27
@NishitRathod27 5 ай бұрын
What is the importance of * in pointers that we are interesting in the syntax
@nikhilsonwane9247
@nikhilsonwane9247 3 жыл бұрын
Sir advertisement Mst he...... 😍
@lovishdhingra801
@lovishdhingra801 4 жыл бұрын
jahapana tuc great ho
@jerlinabraham9724
@jerlinabraham9724 3 жыл бұрын
what is the difference between delete and delete[ ]
@shantanusingh2039
@shantanusingh2039 2 жыл бұрын
Makes it look so easy ❤️
@shrutikahapase9990
@shrutikahapase9990 2 жыл бұрын
Appreciate sir
@MineBeastgamer
@MineBeastgamer 4 ай бұрын
thanks
@chhasnain_offical1082
@chhasnain_offical1082 4 жыл бұрын
Harry bhaii "XML" pr video ho jaye!!
@beastgamer9444
@beastgamer9444 3 жыл бұрын
8:21 why is arr[2] not giving garbage value???
@sunilkumar-ft3nk
@sunilkumar-ft3nk 3 жыл бұрын
Bro same doubt . After delete keyword I am able to delete only 2 int numbers. Have you find the answer why?
@beastgamer9444
@beastgamer9444 3 жыл бұрын
@@sunilkumar-ft3nk no bro
@sukhmandersingh4306
@sukhmandersingh4306 3 жыл бұрын
@@sunilkumar-ft3nk you don't need to worry about what the array contains after deleting it. Delete keyword just means that the address previously used is now free to use again by other new allocations. If you're deleting the array using delete[] it has been correctly deallocated even if the value in those arrays are correct for now. Don't ever use a deallocated resource as that is undefined behavior.
@rudrankitsharma7665
@rudrankitsharma7665 4 жыл бұрын
This recalled the college days.... i loved it.... but what was the thing to dislike in this video.... illogical dislike..... :D :D :D
@gouravgoel2974
@gouravgoel2974 4 жыл бұрын
bhai ek video c++ pe revision ke liye bana do for placements.
@varshagupta2849
@varshagupta2849 3 жыл бұрын
For this you may check out apna collage chanel
@abhzt
@abhzt 4 жыл бұрын
not first but your channel is BEST!
@apurvasonawane5049
@apurvasonawane5049 3 жыл бұрын
Thank you so much harryy bhaii 🥳
@bhavyagulati9293
@bhavyagulati9293 3 жыл бұрын
Pleaseee bhaiya make a video on exception handling🙏🙏🙏 Dikkat aarhi hai please
@amrutanubhab8700
@amrutanubhab8700 2 жыл бұрын
finally we touched half century😇
@trueknowledge2065
@trueknowledge2065 4 жыл бұрын
Sir I am getting a error while installing PYAUDIO What to do sir it is saying please built and install port audio first
@vipulchaudhary_js
@vipulchaudhary_js 3 жыл бұрын
Really Loved it 😻
@akshay.pawar.
@akshay.pawar. 4 жыл бұрын
You are best bhai
@shabanakhatoon6886
@shabanakhatoon6886 4 жыл бұрын
Harry bhaiya have a nice day Hari Bhaiya I was installing the window 10 in the leptop due to the laptop not working properly, but the process stopped in the middle and it is not cutting amd not moving.What do i do now.please Hari bhaiya. Now how do I learn my programming.
@TubaKhalil
@TubaKhalil 6 ай бұрын
Legends to Woh Hain Jo paper sy aik din pehly 2x py pori playlist Dekh rahy hain
@noc12
@noc12 3 жыл бұрын
2 million to go brother
@BATSARK007
@BATSARK007 7 ай бұрын
How did it dereference itself in line 19,20,21 without *?
@mahinpatel8024
@mahinpatel8024 2 жыл бұрын
congratulations everyone for reaching 50th video
@Ubermensch_DEV
@Ubermensch_DEV 2 жыл бұрын
please sir make tutorials for game devloment with unity in c# please
@hosterfr1626
@hosterfr1626 3 жыл бұрын
delete arr ; delete arr [ ] ; In dono mein fark kiya hai?
@huzefausama1603
@huzefausama1603 4 жыл бұрын
Te amo hermano
@GautamKumar-hi2qh
@GautamKumar-hi2qh 4 жыл бұрын
Which IDE is best for python programming 1. Visual studio code. Or 2.Pycharm Please help
@sudarshanmhaisdhune1039
@sudarshanmhaisdhune1039 3 жыл бұрын
Anyone, but let's go with VS Code bcoz it has strong community support and it supports multiple languages
@gamert2525
@gamert2525 4 жыл бұрын
Continue Django plz bhai
@chetansanap3398
@chetansanap3398 4 жыл бұрын
Bhai,GVIM editor se CPP ka set up bta de yrr
@cosmic_021
@cosmic_021 4 жыл бұрын
Always support you
@GauravKumar-ck7rs
@GauravKumar-ck7rs 4 жыл бұрын
Bhai C++ mein STL bhi pdhana 👍👍
@AtulSharma-jr1mn
@AtulSharma-jr1mn 4 жыл бұрын
Bhai ek baar bta do java ka complete course ka laoge
@GauravKumar-dw2ml
@GauravKumar-dw2ml 4 жыл бұрын
Plzz keep goin in c++
@Catharsiswitharthritis
@Catharsiswitharthritis Жыл бұрын
is it because its 64 bit memory space thats why only first two elements of (4 + 4 ) 8 byte were dleted but not the third?
Who’s the Real Dad Doll Squid? Can You Guess in 60 Seconds? | Roblox 3D
00:34
new & delete Operators For Dynamic Memory Allocation | C++ Tutorial
15:52
Portfolio Courses
Рет қаралды 30 М.
12. Stack & Heap | C++ Placement Course
11:02
Apna College
Рет қаралды 386 М.
Polymorphism in C++ | C++ Tutorials for Beginners #54
20:43
CodeWithHarry
Рет қаралды 385 М.
Arrays & Pointers Arithmetic in C++ | C++ Tutorials for Beginners #13
22:22
Pointers in C++ | In Detail | DSA Series by Shradha Ma'am
46:08
Apna College
Рет қаралды 51 М.