1 00:00:14,420 --> 00:00:20,330 Hello and welcome to the goal and programming language course in this session, we want to talk about 2 00:00:20,330 --> 00:00:21,830 the either added concepts. 3 00:00:27,520 --> 00:00:30,860 Copy on at eight by value and reference into another. 4 00:00:32,080 --> 00:00:38,950 You can create a copy of an array by assigning NRA to a new very bill, either by value or reference. 5 00:00:41,020 --> 00:00:48,370 First value, then we assign the value of one validated in another value, then changing the first value 6 00:00:48,370 --> 00:00:54,160 that does not change the second variable because the value of the first value that is copied to the 7 00:00:54,160 --> 00:00:59,920 second variable, which is called the value second reference. 8 00:01:00,460 --> 00:01:07,090 But then we assigned the address of one lady that in another variable changing the value of the first 9 00:01:07,090 --> 00:01:12,550 that he had been honest to change the value of the second lady that it is called reference. 10 00:01:14,930 --> 00:01:23,330 Now, go to this school and illustrate how to use to copy him at a boy venue and reference into an already. 11 00:01:25,190 --> 00:01:37,340 First, define and add and initialize eat, for example, at a long calling equals this global markets 12 00:01:37,910 --> 00:01:45,890 sit three for the length tied a string and curly brackets for initialize 13 00:01:48,380 --> 00:01:48,980 Team 14 00:01:53,150 --> 00:01:53,680 Dean 15 00:01:56,450 --> 00:01:57,140 and be. 16 00:01:59,480 --> 00:02:06,560 So create an array and copy at Avon into this in the next line. 17 00:02:07,310 --> 00:02:14,120 Ray two calling equals and copy anyone to eat. 18 00:02:14,360 --> 00:02:19,910 I want data is passed by value. 19 00:02:21,290 --> 00:02:27,560 Now define another variable and copy anyone into this array. 20 00:02:29,990 --> 00:02:41,750 Three content equals and copy the address of the variable at Avon into this and array one. 21 00:02:42,920 --> 00:02:50,570 In this case, data is passed by a reference if we want to pass a reference value we use from ampersand 22 00:02:50,570 --> 00:02:52,520 symbol before the variable. 23 00:02:54,950 --> 00:03:00,950 Now display at Avon and added to if it 24 00:03:03,850 --> 00:03:17,570 at a long balance percent v lowercase legislation and sets only one, then 25 00:03:20,240 --> 00:03:21,050 it has 26 00:03:24,290 --> 00:03:38,870 a two tolerance person to lowercase registers and and sets I to say inclusion and continue. 27 00:03:40,790 --> 00:03:46,570 Now we change the index zero five at Avon Valley Bin and print on Vati. 28 00:03:46,580 --> 00:03:58,280 Even again, do the following Add a long list of broadcast and index zero and we change the venue of 29 00:03:58,280 --> 00:03:59,330 it to. 30 00:03:59,330 --> 00:04:01,100 For the example, Alex 31 00:04:04,040 --> 00:04:09,440 now display all the variables for these. 32 00:04:09,830 --> 00:04:11,630 Copied these two lines 33 00:04:14,330 --> 00:04:15,410 and paste here 34 00:04:19,820 --> 00:04:26,420 for display the pointer variables we use from star symbol before variable name. 35 00:04:26,630 --> 00:04:31,130 So for print the variable ADT, we use this code. 36 00:04:31,370 --> 00:04:32,350 If if 37 00:04:37,370 --> 00:04:43,400 at a tree pollens person to the lower case 38 00:04:46,700 --> 00:04:58,740 and sets the star add a tree, the format, the cool, save the project and execute the code. 39 00:05:03,320 --> 00:05:09,020 Now we can see the output in the first variable. 40 00:05:09,230 --> 00:05:11,750 We have changed index zero value. 41 00:05:12,500 --> 00:05:19,880 When you print it, the first variable is printed with the new menu in the second. 42 00:05:19,880 --> 00:05:27,050 Very bad because the value of the first variable is copied inside it, or in other words, data is passed 43 00:05:27,050 --> 00:05:27,920 by value. 44 00:05:28,070 --> 00:05:36,350 So no change will be made in the second variable, but in the third variable, because the address of 45 00:05:36,350 --> 00:05:42,140 the first variable is assigned in the third variable or in other wars. 46 00:05:42,140 --> 00:05:44,210 Data is passed by reference. 47 00:05:44,510 --> 00:05:51,020 The value of the first element of the third variable will also change and the third variable will be 48 00:05:51,020 --> 00:05:52,520 printed within nil value. 49 00:05:55,210 --> 00:06:02,950 Now we could copy and Ari by venue and reference into another area in order not to prolong the time 50 00:06:02,950 --> 00:06:03,710 of decision. 51 00:06:03,730 --> 00:06:07,510 We will finish it and we will continue the content in the next session. 52 00:06:07,930 --> 00:06:08,470 Goodbye.