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

  Рет қаралды 269,342

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

Пікірлер: 281
@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 2 жыл бұрын
🥲
@kumkumbhagya51
@kumkumbhagya51 Жыл бұрын
yes we did it🤝🤝
@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???
@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💓💓💓💓💓💓💓💓💓💓💓💓
@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....
@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
@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
@anonymous_ghost_123
@anonymous_ghost_123 2 жыл бұрын
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...
@kieieiee9343
@kieieiee9343 3 жыл бұрын
finally reached the 50 th video , lets finish this now
@nachiketpushkarna3295
@nachiketpushkarna3295 3 жыл бұрын
yes bro
@tayyabsami258
@tayyabsami258 Жыл бұрын
Alhamdulilah reached half century of the vedio of this playlist .Thanks a lot😍
@Rehan-fz3vt
@Rehan-fz3vt 4 ай бұрын
yeppp
@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
@nahushdeshmukh9375
@nahushdeshmukh9375 Жыл бұрын
Most advanced channel for coding on desi language❤
@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.
@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.
@prabhattiwari007
@prabhattiwari007 3 жыл бұрын
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 Жыл бұрын
Harry be like: backchodi mat kr l×××e😂😂
@computerknowledge7183
@computerknowledge7183 Жыл бұрын
😂😂
@pavan305
@pavan305 3 жыл бұрын
Finally i've reached half century.... OOPs mai bohot maza aagaya abhi tak.... LOooking forward to complete course ASAP
@zebra-er6xc
@zebra-er6xc 3 жыл бұрын
bhai baki videos mei kitna time laga 50 to 74?
@gayatribelhekar9054
@gayatribelhekar9054 3 жыл бұрын
Your hard work is really appreciable. Keep Going Harry ! people like you are real gems of KZbin !!
@051-rahulchourasia8
@051-rahulchourasia8 4 жыл бұрын
Strike half-century today ten more left Thank you harry bhaiya
@ThomasShelby-s1q
@ThomasShelby-s1q 6 ай бұрын
#Note. Normally in c++ memory allocated in stack. but dynamically allocated memory assign in heap.
@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
@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
@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 3 жыл бұрын
I wanted to ask the same question!
@sandeepkumartiwari8436
@sandeepkumartiwari8436 3 жыл бұрын
@@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
@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 3 жыл бұрын
Yeah please
@kumkumbhagya51
@kumkumbhagya51 Жыл бұрын
6:14 kyuki vo ek array hai isliye [ ] ye waale brackets use hai
@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🙂
@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 😍😍🤣🤣🤦‍♂🤦‍♂
@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!
@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++
@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
@anitaaggarwal6981
@anitaaggarwal6981 4 жыл бұрын
CONGRATULATIONS FOR 402K SUBS Harry BHAI !
@zeno30703
@zeno30703 3 жыл бұрын
He quadrapuled that value in a year. Damn!
@abuzargour3030
@abuzargour3030 5 ай бұрын
You arr so great 🎉
@altamashsabri8142
@altamashsabri8142 4 жыл бұрын
Bestem best Harry bhai💪💪💪
@swostideepnayak5412
@swostideepnayak5412 Жыл бұрын
sir plz make a playlist for dsa in cpp its most demanded
@vedantsayys
@vedantsayys 6 ай бұрын
finally completed 50 lectures !!!
@jainilprajapati9786
@jainilprajapati9786 3 жыл бұрын
Today am GTU's 3rd sem exam of computer and i only refer you videos ❤️.
@beastgamer9444
@beastgamer9444 4 жыл бұрын
8:21 why is arr[2] not giving garbage value???
@sunilkumar-ft3nk
@sunilkumar-ft3nk 4 жыл бұрын
Bro same doubt . After delete keyword I am able to delete only 2 int numbers. Have you find the answer why?
@beastgamer9444
@beastgamer9444 4 жыл бұрын
@@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.
@abhzt
@abhzt 4 жыл бұрын
not first but your channel is BEST!
@vaibhavmore1051
@vaibhavmore1051 4 жыл бұрын
Sir, Please make a playlist on the meanstack course.
@nilusingh75
@nilusingh75 14 күн бұрын
can we say that new keyword in cpp and malloc keyword in C are same?
@vipulsinghania5057
@vipulsinghania5057 4 ай бұрын
#include using namespace std; int main(){ // basic example int a = 4; int *ptr = &a; cout
@Asish0089
@Asish0089 Жыл бұрын
8:16 8:46
@darpanPednekar
@darpanPednekar 4 жыл бұрын
Sir please make a playlist on Angular
@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?
@PrashantKumar-wk1xb
@PrashantKumar-wk1xb 3 жыл бұрын
Thankyou sir for providing us free video
@irfanahmad-uy6dx
@irfanahmad-uy6dx 9 ай бұрын
Plz also make a vedio on aggregation and composition plz
@devanshsaxena1585
@devanshsaxena1585 3 жыл бұрын
What is difference between delete arr and delete [ ] arr ? Both are freeing the memory block
@sandeepkumartiwari8436
@sandeepkumartiwari8436 3 жыл бұрын
I think their is no difference between delete arr or delete [ ] arr
@SAHIL----10
@SAHIL----10 11 ай бұрын
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.
@HarishKumar-jm5bk
@HarishKumar-jm5bk 4 жыл бұрын
Harry sir please please 🙏 c++ ka data structure bhi krwa dena
@shaheenkhan868
@shaheenkhan868 2 жыл бұрын
At 9:57 can anyone tell me why the arr[2] value did not change or gets deleted
@TubaKhalil
@TubaKhalil 8 ай бұрын
Legends to Woh Hain Jo paper sy aik din pehly 2x py pori playlist Dekh rahy hain
@muhammadareebkazmi9476
@muhammadareebkazmi9476 2 жыл бұрын
Thank you, Harry bhai!
@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
@amrutanubhab8700
@amrutanubhab8700 2 жыл бұрын
finally we touched half century😇
@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
@nikhilsonwane9247
@nikhilsonwane9247 3 жыл бұрын
Sir advertisement Mst he...... 😍
@IDK-sk2yj
@IDK-sk2yj 2 жыл бұрын
superb explanation sir.
@MonikaKumari-er4de
@MonikaKumari-er4de 2 жыл бұрын
Thank you 😊
@dharmik5442
@dharmik5442 3 жыл бұрын
You are my mentor❤
@sonigupta9879
@sonigupta9879 4 жыл бұрын
Sir, please come up with react js tutorial. 🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻
@miss_surpiya_23
@miss_surpiya_23 4 жыл бұрын
yeh fir..koi or.. Idea doubts clear krne...ke liye🙏🙏
@apurvasonawane5049
@apurvasonawane5049 3 жыл бұрын
Thank you so much harryy bhaii 🥳
@hritikworld9944
@hritikworld9944 4 жыл бұрын
Thank you so much for your amazing videos
@miss_surpiya_23
@miss_surpiya_23 4 жыл бұрын
sir app live aa sakte ho.... doubts ke...liye...plzz...🙏🙏🙏
@saadhassan8813
@saadhassan8813 8 ай бұрын
Thanks Dr Harry
@noc12
@noc12 3 жыл бұрын
2 million to go brother
@kumkumbhagya51
@kumkumbhagya51 Жыл бұрын
3:39 vaise humne isme ptr ki value nikaali kyuki a ki value check krne ke liye hum bas
@dhruvnation1884
@dhruvnation1884 4 жыл бұрын
Thnx for the helpful tutorial
@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.
@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?
@NishitRathod27
@NishitRathod27 8 ай бұрын
What is the importance of * in pointers that we are interesting in the syntax
@vipulchaudhary_js
@vipulchaudhary_js 3 жыл бұрын
Really Loved it 😻
@royfamily9273
@royfamily9273 2 жыл бұрын
Thanks Harry Bhaiya
@jerlinabraham9724
@jerlinabraham9724 3 жыл бұрын
what is the difference between delete and delete[ ]
@MahnoorAkhtar-b4f
@MahnoorAkhtar-b4f 6 ай бұрын
Thanks sir...😊
@mahinpatel8024
@mahinpatel8024 2 жыл бұрын
congratulations everyone for reaching 50th video
@shantanusingh2039
@shantanusingh2039 2 жыл бұрын
Makes it look so easy ❤️
@gauravsrivastava5947
@gauravsrivastava5947 3 жыл бұрын
Sir please make the Roadmap for Software Engineer
@HarshitaUpadhyay-har2u
@HarshitaUpadhyay-har2u 3 ай бұрын
I am regretting that I watched your video late, and wasted my time on watching other channels videos....😢
@mevishalcoder
@mevishalcoder 4 жыл бұрын
Bhai "Java" par kab Playlist bana rahe ho ?
@DK-dp1pt
@DK-dp1pt 2 жыл бұрын
why 3rd array element is not destroyed(arr[2] = 30) ??
@harshikasindwani27
@harshikasindwani27 Жыл бұрын
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
@gopalidhole8452
@gopalidhole8452 4 жыл бұрын
8:20 Can anyone answer it!! why arr[2] was not deleted when he use delete??
@sudhakarsahu344
@sudhakarsahu344 4 жыл бұрын
it is rare in output to come garbage value as same as noted no. in coding as 30 in this video. do code in your system as clear confusion..thanks
@PunamKumari_11
@PunamKumari_11 4 жыл бұрын
🙏🙏Make a series on hacking.🙏🙏
@rakeshkumarmeena8107
@rakeshkumarmeena8107 4 жыл бұрын
You can follow bitten tech for hacking
@Stolen__spirit
@Stolen__spirit 2 жыл бұрын
#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 !!
@mdrehanfarid2134
@mdrehanfarid2134 3 жыл бұрын
Sir hr language ki important questions kr wa digiye
@Sujit_Badgujar
@Sujit_Badgujar 3 жыл бұрын
💗Harry bhai 💗
@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
@chhasnain_offical1082
@chhasnain_offical1082 4 жыл бұрын
Harry bhaii "XML" pr video ho jaye!!
@akshay.pawar.
@akshay.pawar. 4 жыл бұрын
You are best bhai
@tusharpaul5757
@tusharpaul5757 Жыл бұрын
why does delete[ ] operator deletes only first two indices of the array and rest are retained? anyone knows the answer?
@krishnakhandelwal12kk
@krishnakhandelwal12kk Жыл бұрын
Same condition bro
@krishnakhandelwal12kk
@krishnakhandelwal12kk Жыл бұрын
Do you know on leetcode ther e is only coding through hashmaping in c++ which i don't know Can please tell me about other platforms
@adhipbhattarai3889
@adhipbhattarai3889 3 жыл бұрын
why this delete operator delete only 2 elements?
@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.
@cosmic_021
@cosmic_021 4 жыл бұрын
Always support you
@bhavyagulati9293
@bhavyagulati9293 3 жыл бұрын
Pleaseee bhaiya make a video on exception handling🙏🙏🙏 Dikkat aarhi hai please
@GauravKumar-dw2ml
@GauravKumar-dw2ml 4 жыл бұрын
Plzz keep goin in c++
@lovishdhingra801
@lovishdhingra801 4 жыл бұрын
jahapana tuc great ho
@Akshay-md4vf
@Akshay-md4vf 3 жыл бұрын
What is keyboard button for double type ??
@manjitsharma889
@manjitsharma889 3 жыл бұрын
press alt and click the mouse on the places you want the cursor to be
@bcaeducation4913
@bcaeducation4913 3 жыл бұрын
thnx bhaiya
@abdullah_saeed10
@abdullah_saeed10 2 жыл бұрын
yrr pointers ki tou bht mushkil se samajh aa gyi lekin ab ye new aur delete keywords ko smajhne me kaafi time lage ga
@BATSARK007
@BATSARK007 10 ай бұрын
How did it dereference itself in line 19,20,21 without *?
@shrutikahapase9990
@shrutikahapase9990 2 жыл бұрын
Appreciate sir
@GauravKumar-ck7rs
@GauravKumar-ck7rs 4 жыл бұрын
Bhai C++ mein STL bhi pdhana 👍👍
It’s all not real
00:15
V.A. show / Магика
Рет қаралды 20 МЛН
Мен атып көрмегенмін ! | Qalam | 5 серия
25:41
小丑女COCO的审判。#天使 #小丑 #超人不会飞
00:53
超人不会飞
Рет қаралды 16 МЛН
Why Indian Laws Hate Men? | Open Letter
15:41
Open Letter
Рет қаралды 14 М.
Tools EVERY Software Engineer Should Know
11:37
Tech With Tim
Рет қаралды 22 М.
Operator Overloading in C++ Programming | C++ Programming for Beginners
13:32
Polymorphism in C++ | C++ Tutorials for Beginners #54
20:43
CodeWithHarry
Рет қаралды 405 М.
Hardy's Integral
13:47
Michael Penn
Рет қаралды 15 М.