1 00:00:15,510 --> 00:00:18,900 Hello and welcome to the goal and programming language course. 2 00:00:19,230 --> 00:00:26,070 In the previous session, we talked about declaration and initialization of pointers in this session. 3 00:00:26,100 --> 00:00:29,160 We want to talk about the others pointers concept. 4 00:00:33,620 --> 00:00:43,190 Neil, pointers in goo goo compiler assign initial value to a pointer very bad in case you don't have 5 00:00:43,190 --> 00:00:45,230 exact address to be assigned. 6 00:00:46,460 --> 00:00:54,360 This is done at the time of variable declaration, a pointer that is assigned Neal is called in need 7 00:00:54,360 --> 00:00:54,980 of pointer. 8 00:00:56,750 --> 00:01:05,960 The need point there is a constant with a value of zero defined in several standard libraries to check 9 00:01:05,960 --> 00:01:10,670 for a need point where you can use and if a statement as follows. 10 00:01:12,800 --> 00:01:17,960 Now go to this code and illustrate how to declaring Neil pointers. 11 00:01:21,360 --> 00:01:34,380 First, define the point of a variable valve p star and now do the following code for check need or 12 00:01:34,380 --> 00:01:34,770 not. 13 00:01:35,790 --> 00:01:36,360 If 14 00:01:39,270 --> 00:01:43,500 P equals, he calls mean 15 00:01:46,500 --> 00:02:00,450 so display the message if if the value of B is first x lowercase back is less and and. 16 00:02:01,860 --> 00:02:02,190 He. 17 00:02:04,550 --> 00:02:08,840 He the quote, save the project and execute the program. 18 00:02:11,010 --> 00:02:15,810 Now we can see the output, the value of P is zero. 19 00:02:17,740 --> 00:02:25,600 On most of the operating systems, programs are not permitted to access memory at address zero because 20 00:02:25,600 --> 00:02:28,600 that memory is reserved by the operating system. 21 00:02:28,900 --> 00:02:33,310 However, the memorial address zero has a special significance. 22 00:02:33,760 --> 00:02:41,230 It signals that the pointer is not intended to point to an accessible memory location, but by convention. 23 00:02:41,230 --> 00:02:47,030 If a pointer contains the needle or zero value, it is assumed to point to nothing. 24 00:02:48,940 --> 00:02:51,340 Now go to your slides and continue. 25 00:02:56,070 --> 00:03:03,900 Changing Poland to a value, you can also change the value of the to or the memory location instead 26 00:03:03,900 --> 00:03:06,780 of assigning annual value to the value of it. 27 00:03:07,950 --> 00:03:12,360 Now go to this good program to illustrate the above mentioned concept. 28 00:03:15,250 --> 00:03:16,780 First, clear, the last court. 29 00:03:19,020 --> 00:03:20,580 And save the project. 30 00:03:21,810 --> 00:03:23,340 It's ready to write code. 31 00:03:24,300 --> 00:03:30,480 First, create a variable using vata keyboard, and we are not defining any type of value, but for 32 00:03:30,480 --> 00:03:36,540 the example, via a equals 458. 33 00:03:38,390 --> 00:03:47,360 Now taking a point Revathi been using via Ward without specifying the type that P equals. 34 00:03:49,010 --> 00:03:51,010 Signed a value that. 35 00:03:54,630 --> 00:04:01,530 Display value of every bit and avarice of every bit and pawn in therapy before changing. 36 00:04:02,810 --> 00:04:18,230 FP value stored in a variable equals a go to the next time. 37 00:04:18,290 --> 00:04:18,890 FP. 38 00:04:20,790 --> 00:04:30,790 Address a rally there, he calls Anderson a. 39 00:04:31,380 --> 00:04:43,470 And go to the next line if P value stored in pointer. 40 00:04:45,090 --> 00:04:57,750 T equals and set the value of the P here before the code and say the project now using Asterix or Create 41 00:04:57,750 --> 00:05:00,600 will be for points are very able to access. 42 00:05:00,600 --> 00:05:10,050 The value is stored at the very well at which is it is pointing now write the code if P value. 43 00:05:11,810 --> 00:05:15,350 It's taught in. 44 00:05:16,610 --> 00:05:28,770 Star P before changing, he calls the star P. 45 00:05:33,130 --> 00:05:37,990 Save the project, go to terminal and execute the program until here. 46 00:05:41,910 --> 00:05:53,190 Now we can see the output value soared in a able equals 458 address of a variable and value a sort in 47 00:05:53,190 --> 00:06:04,500 point or p r, the hexadecimal format and value is stored in Astra's before changing equals 458. 48 00:06:05,160 --> 00:06:11,160 Now go to code and change value off point or go to the next line. 49 00:06:12,180 --> 00:06:20,960 Changing the value of a variable by assigning the new value to the pointer is star p equals for the 50 00:06:20,970 --> 00:06:27,810 example five hundred and go to the next line and again display. 51 00:06:27,810 --> 00:06:44,130 The value is stored in asterisks p if p value is stored in star b after changing. 52 00:06:45,960 --> 00:06:57,480 Equals and set the variable a reformat, the quote saved the project and go terminal and execute again. 53 00:06:59,690 --> 00:07:08,060 Now we can see the output value restored in this star after changing equals five hundred. 54 00:07:08,780 --> 00:07:17,360 In this example, the first define a very bad and initialize it, then put the address of that variable 55 00:07:17,360 --> 00:07:18,800 inside and pointer. 56 00:07:19,760 --> 00:07:27,710 Now, by changing the pointer value, we will see that the value inside the initial variable also changes. 57 00:07:29,030 --> 00:07:34,850 In order not to prolong the time of decision, we will finish it and we will continue the content in 58 00:07:34,850 --> 00:07:35,960 the next session. 59 00:07:36,180 --> 00:07:36,770 Goodbye.