Dynamic Memory Allocation in C++ Part 1 | C ++ Tutorial | Mr. Kishore
Vložit
- čas přidán 29. 08. 2024
- C ++ Tutorial Videos | Mr. Kishore
** For Online Training Registration: goo.gl/r6kJbB ► Call: +91-8179191999
💡 Also Watch
C Language Tutorials: goo.gl/qDhJ2r
Core Java FAQ's: goo.gl/qGh5mA
Core Java Tutorials: goo.gl/NbaEge
Java Programming Tutorials by Mr.Hari krishna:
goo.gl/HThq6H
Advanced Java Programming Tutorials by Mr.Nataraj:
goo.gl/1U2Qgy
Subscribe to our channel and hit the bell 🔔🔔🔔 icon to get video updates.
💡 Visit Our Websites
For Classroom Training: nareshit.in/cp...
For Online Training: nareshit.com/c...
#JavaCollectionsFramework #Tutorials #Videos #corejava #Quiz #Clanguage
--------------------------
💡 About NareshIT:
"Naresh IT is having 14+ years of experience in software training industry and the best Software Training Institute for online training, classroom training, weekend training, corporate training of Hadoop, Salesforce, AWS, DevOps, Spark, Data Science, Python, Tableau, RPA , Java, C#.NET, ASP.NET, Oracle, Testing Tools, Silver light, Linq, SQL Server, Selenium, Android, iPhone, C Language, C++, PHP and Digital Marketing in USA, Hyderabad, Chennai and Vijayawada, Bangalore India which provides online training across all the locations
--------------------------
💡 Our Online Training Features:
🎈 Training with Real-Time Experts
🎈 Industry Specific Scenario’s
🎈 Flexible Timings
🎈 Soft Copy of Material
🎈 Share Videos of each and every session.
--------------------------
💡 Please write back to us at
📧 us.training@nareshit.com/ 📧 online@nareshit.com or Call us at the USA: ☎+1404-232-9879 or India: ☎ +918179191999
--------------------------
💡 Check The Below Links
► For Course Reg: goo.gl/r6kJbB
► Subscribe to Our Channel: goo.gl/q9ozyG
► Circle us on G+: plus.google.co...
► Like us on Facebook: / nareshit
► Follow us on Twitter: / nareshitek
► Follow us on Linkedin: goo.gl/CRBZ5F
► Follow us on Instagram: goo.gl/3UXYK3
Please Comment, Subscribe and Click Bell🔔🔔🔔 Icon for More Updates. To learn software course from our experts please register here for online training: goo.gl/HIB0wL
add Using namespace std before main function and delete array using delete [] a;
Sorry to be offtopic but does someone know a method to get back into an Instagram account??
I somehow forgot my account password. I would appreciate any assistance you can give me!
This tutorial is Unique. because it begins with "why do we need dynamic memory allocation?" Respect!
love the way you explain everything, thank you, sir, from California ..
I have my exam this Monday and today I finally understand how dynamic memory works. Thank you for this comprehensible tutorial guru 🙏🏻.
you should use "delete [] a;" instead of "delete a;", (in arrays)
otherwise it will not release all allocated memory.
example:
int n = 3;
int * a = new int[n];
//......
delete [] a;
I was going to type the same thing but found your comment
@@AnkitSaiyan +1 :D
Just one word to describe this video
Wow!!!!!
I have seen number of videos on this topic but none of them get in my head finally i found this amazing video which really tells what is going on in a simple manner
Once again thank u
Great Lectures by Uuh Sir 😍
Pakistani professors are not doing it for us. So shamefull 😓😓😓
@Sana Mahnoor yeah offcourse they are matchless but here i am talking about the CZcams channels they are not doing this
@@yashrsd TMKB
Finally after enough struggle i understood DMA
Thank you so much sir
@20:57 it is *(p+i) because we want to store the value and the (p+i) states it is pointing to that address, therefore it is *(p+i) not (p+i).
exactly
No one has made dma as simple as u made .. thank u sir... for this expalnation
Sorry sir .....but in previous video we studied manipulators not static memory allocation ...where is the video of static memory allocation...??
Sir was high i guess
yes we cant find the video of static memory allocation
Where is d video for static memory allocation..plzz rply
@@rohitverma-xz2uy same
Sir, your lectures are best resources for digital India. Thank you .
You are the best c++ prof ever......
It also works except for the memory cannot be deallocated.
int n;
cout > n;
int arr[n];
cout
You are the best sir!.love ur teaching
Thank you sir for knowledge. Its great explanation about dynamic memory allocation.
#Naresh i Technologies ... It should be *(p+i) for both cin and cout.
Sir static memory allocation is not there in the playlist
Please reload the video
Kishore sir was explained C++ very good 👌👌👌
//i think that dynamic memory allocation can be done without pointer and new function
//just take a look at this program
//do correct me if i am wrong
#include
using namespace std;
int main()
{
int n;
coutn;
int a[n];
for(int q=0;q>a[q];
}
for(int q=0;q
You didn't use dynamic memory, it has to use new to create dynamic memory else it will stack memory.
U allocated static memory
sir ur institute is dng great pls upload the videos on networking also...
sir , i'm u r student, and i like u r teaching so much.....sir, plz upload all videos of c++ (i.e arrays,inheitance, pollymorphism videos) as possible as fastly.............mi and my all friends are waiting to watch u r remaining videos.............plz, clear the conept of linked list , functions and inheritance .....with daily life examples.........and sir i'm so much happy whenever i was see u on you tube.........sir, provide all videos fastly..........
Sir
Then why it showing that variables value after calling delete
#include
using namespace std;
int main()
{ int n,i,j;
cout
Thank you very much for your detailed explanation. this program, I have tried on vs2012. It's only printing r*c value. After that it's not giving the remaining couts.
Thank u sir it is very help me
Sir when u are putting in values u need to write cin>>*(p+i) instead of cin>>(p+i).
Nice explain sir love it
Great teaching Sir thank you so much Sir 🙏🙏🙏🙏🙏🙏🙏🙏
forget the [ ] when deleting the dynamically allocated memory or is it not needed that is
delete [ ] p;
Sir
mind flowing ,
extradinary ,
Fantastic......
I like your way of teaching my college teachers are waste but you are only one best way of teaching
KISHORE SIR
😍
This man should taught all the subjects
Thank you very much. Best video on this concept so far from what I could find
Here you forgot to add * in (p+i) while taking input in array. Your video was good.
Please write delete [ ] P;. To release memory
while allocating memory, ex: 65500, next address will be 65502, 504,.. so on. not 512,514... for 16 bit compiler.
Hi i have one doubt new int(3) will it allocate memory of 6 bytes or the value 3 will store in that memory of int.. If possible can you please reply
I got confused by this video.. Sorry to say this..
Love from Pakistan dear Sir ❤❤😍😍❤❤
Sir plz uploads all videos some videos u have skipped
Thank you so much for such clear and excellent explaination!
Thank you sir
thanks sir totaly got it sir
Sir plz upload video in order.. otherwise it is of no use to us, and we have to compormise it from other youtube channel which we dont want .
Sir your explaination is amazing..😊,
Sir i am having a doubt that when i am using cin>>(p+i) it is giving an error but cin>>p[i] is running fine, but why cin>>(p+i); giving an error??
please try: *(p+i)
@@aaminaminur4413 but *(P+i) is used for printing actual value stored in pointer.But she want to store value....
@@maheshshirsat9075 if you use cin>>
*(p+i) you can store the value....inside a for loop
This is definitely gone print error as we had declared an array but we haven't entered and scanned the array values. This is going to print some garbage value
Excellent teaching
Plz upload more tutorials of c++
sir you are a very good cpp teacher.
Love the way you teaching..
Sir please upload all videos of features of c++
Thanks so much. Well explained.
Great explanation. Thank You!!!
cameraman is also learning c++😂 cameraman is legend
Can you pls arrange this playlist in sequence so that it would be efficiently accessible .
bhai order me pta chla?
@@gauravraj4507 bhai oder pta chla bhai
@@rohitverma-xz2uy nhi bhai, ab khi or se pdhna pd rha hai😔.. Agr inke order me hoti to best site thi ye c++ k lie
why he doesn't write "using namespace std" in his programs?
Instead of namespace he used conio.h
Sir do work in turbo
Bhul Gaye honge
Where the previous session of static memory allocation its nt in the playlist
Nice explanation ❤️🙂
can I work on any c++ project (my 1st project) after learning from this playlist ??
Excellent teaching,😊
You r the best
sir we can also declare an array as a[n]...So why we use new. Operator.
10:19 sir integer requires 4 byte memory
Wrong
@@ansaribelalahmed9179 yes i googled it in 32 bit pc its 2 bytes ,in 64 bit pc its 4 bytes
Sir you are not getting the integers entered through keyboard please insert a code to enter array values and scan the entered values
Thankyou sir
Super thalaiva
Mindboggling👌👌👌👌👌
sir, in this video you are doing too much verbal teaching please explain by writing in board....
in last program how the compiler know 'n' is array type variable?
Sir you are amazing Thanks alooooooooot
shouldn't that be delete []p ?
Nice explanation sir
there are some minor errors in your program : 1.iostream is independent can be used without .h
2.conio.h is a turbo specific header file, not specified in c or c++.(Sir you need to update yourself to a better modern compiler).
3.Not using namespace std;
he must have been updated himself now.this video was posted in 2017
15:16
good work sir keep it up
We could also use this code :
#include
using namespace std;
int main()
{
int n;
cin>>n;
int arr[n];
for(int i =0; i>arr[i];
}
for(int i =0; i
after you are done using your program , the array you created still holds the the memory while in DMC we get our memory back once the purpose of program is completed
Tq sir ur great
In arrays allocation of memory starts from 0 ,do I am right
Best programming you tube channel
Sir How p[i] can be used for input and output?
awsm teacher
Superb class🙏
Great job !
can you give the proper sequence of video
bro what the use of dma
Sir how to create cpp file shortcut on desktop... I couldn't get that... Bcoj while opening my turbo c++ i takes more time... Anybody plz tell me.. how to create shortcut cpp file on desktop. To open direct blank progrm....
Cin>>(p+i); not working on VS code
We may also do free(ptr)I guess!
Where is the previous lecture??
Have you found previous vdo 🙄
good work sir
I have a question or confusion in the program. as we know when we declare variable then memory is allocated for that variable ..( int *p; int *q; int *r ;
then why we say that ,we have to use 'new' keyword to allocate memory for the variable??
He declared pointers variables not variables.
This is what is called allocating memory dynamically
sir . one basic doubt , #include here .h is not accepted IDE...as i am fresher i could't find it...please help with that
C++ mein no need to write .h with any header file just write iostream
Thank you Sir...
you are the best professor
Isn't 1 int=4 byte?you are saying that 2 byte!!!!
Sir told 2 bytes according to 16bit computer.
sir,it should be cin>>*(p+i);
same i thought
#include
using namespace std;
int main()
{
int n;
coutn;
int *p=new int[n];
for(int i=0;i>p[i];
}
cout
Can you explain why you put 7, 4, 9 in those blocks at time 22:50
Just for example he did it. But there is a part of code missing which is needed to print enter the three integers and scan them.
sir, why do you use getch() function at the end all the time when you don't want to take any input?
its used to hold the screen otherwise ur program exits quickly
send me the link for static memory allocation
www.youtube.com
Sir first for loop me value store ke liye aap cin me aap (p+i) ka use kiye h but second cin me aap *(p+i) ka use kiye hain aisa kyu
Plz any one clear my doubts
Should be *(p+i) in both cases
@@bestganesh no bro it is correct. for storing the value we use(p+i) and for printing we use *(P+i) that is dereferencing.
@@maheshshirsat9075 are you sure?
I think there would be delete []p; not deletr p;
Sir how to do it using class
sir please tell me,
where is 'i' declared in program
In the for loop.
heap explainion please