1
00:00:00,330 --> 00:00:09,200
Hi, folks, let's start today's session, not today's topic is new and delete operators in TPP.

2
00:00:10,080 --> 00:00:16,320
So before moving forward, let's discuss about the dynamic memory allocation and dynamic memory allocation,

3
00:00:16,800 --> 00:00:22,440
because new and delete operators are just the implementation of both of these concepts.

4
00:00:23,010 --> 00:00:30,360
So dynamic memory allocation is a concept that programmers manually allocate a memory to a particular

5
00:00:30,360 --> 00:00:32,530
variable like dynamic memory.

6
00:00:32,560 --> 00:00:39,030
The allocation is a concept where a definite component of memory, which was allotted to a particular

7
00:00:39,030 --> 00:00:43,890
variable using dynamic memory allocation, is released dynamically.

8
00:00:44,670 --> 00:00:52,920
Example of automatic memory allocation and the allocation is the electricity here in automatic memory

9
00:00:52,920 --> 00:00:53,670
allocation.

10
00:00:53,790 --> 00:01:00,390
It's the responsibility of the compiler to allocate and release this particular memory automatically.

11
00:01:00,960 --> 00:01:01,320
Right.

12
00:01:01,320 --> 00:01:07,980
In case of dynamic memory allocation, the I like a particular amount of memory here we are assigning

13
00:01:07,980 --> 00:01:08,790
two byte.

14
00:01:10,160 --> 00:01:15,950
To this particular variable using Newquay word, so it's the case of dynamic memory allocation.

15
00:01:16,280 --> 00:01:23,210
So it's the responsibility of the programmer to educate and develop, that means to release this particular

16
00:01:23,210 --> 00:01:24,590
memory dynamically.

17
00:01:25,400 --> 00:01:29,330
Now let's discuss about the new and delete operators.

18
00:01:29,810 --> 00:01:35,410
So new operators are used to allocate this particular memory dynamically.

19
00:01:35,930 --> 00:01:43,100
So new operators, as shown in this particular example, is used to allocate this Intisar type memory

20
00:01:43,280 --> 00:01:44,750
to this particular variable.

21
00:01:45,410 --> 00:01:46,280
Why delete?

22
00:01:46,490 --> 00:01:53,060
Delete is used dynamically allocate the memory assigned to a particular variable using a new operator.

23
00:01:53,870 --> 00:01:56,270
Now let's move forward with the coding.

24
00:01:56,270 --> 00:02:00,920
But so here we have a simple representation of main function.

25
00:02:02,380 --> 00:02:05,820
Now, let's create the point that variable.

26
00:02:07,920 --> 00:02:18,570
Into point thirty here, we will create and assign a value to this dynamically now before going to the

27
00:02:18,570 --> 00:02:23,710
line number seven, since they want to release this particular memory allocated to point to variable

28
00:02:23,720 --> 00:02:30,120
variability, we will use the keyword and delete and will release this using the LATAPY.

29
00:02:30,870 --> 00:02:39,060
So here what we are doing is we are just assigning the variable, assigning a memory to this variable

30
00:02:39,060 --> 00:02:43,180
particular pointer, be using new keyword dynamically.

31
00:02:43,770 --> 00:02:47,310
So it's a case of dynamic

32
00:02:50,220 --> 00:02:50,880
memory.

33
00:02:53,360 --> 00:02:55,490
Allocation Garchik,

34
00:02:58,540 --> 00:03:00,010
I have some mistakes.

35
00:03:00,310 --> 00:03:06,910
Yup, so here we have a simpler case of a dynamic allocation and.

36
00:03:09,470 --> 00:03:17,580
Since we since we are using the key word here, so it's a case of dynamic memory, be a location.

37
00:03:18,110 --> 00:03:20,460
So that's all about new and delete operators.

38
00:03:20,750 --> 00:03:21,620
Thanks for watching.
