1 00:00:00,240 --> 00:00:01,890 So now let's move that dam. 2 00:00:02,370 --> 00:00:09,270 This is a kind of a complex topic because you don't have sufficient ways to visualize what's happening 3 00:00:09,270 --> 00:00:15,840 inside, but you have to think and understand this properly, like how the fine is actually getting 4 00:00:15,840 --> 00:00:25,650 working and how that Gaza in order like if you are putting it not bad or if you are opening a word document, 5 00:00:26,010 --> 00:00:28,380 you can see the concept of it. 6 00:00:28,440 --> 00:00:35,390 But if you are putting that file programmatically in C++, you will not be able to see the cursor that 7 00:00:35,400 --> 00:00:38,620 is the cursor or leave from the cursor and you can read or write, right? 8 00:00:38,820 --> 00:00:43,630 So based on the cursor, you want to change that position of the characters. 9 00:00:43,950 --> 00:00:46,950 So that's maybe going to be using all these functions. 10 00:00:47,070 --> 00:00:51,240 So now let's move to a quick and simple demo of files. 11 00:00:51,480 --> 00:00:58,440 Let me move to Visual Studio Core, where we have a good example for fires. 12 00:00:59,310 --> 00:01:00,870 Let's start here. 13 00:01:01,290 --> 00:01:07,860 So if you look into this program, you can see if stream had refining included because without this 14 00:01:07,860 --> 00:01:11,640 extreme fire, we will not be able to do anything with files. 15 00:01:11,940 --> 00:01:21,150 And here I am, trying to create the array, which holds about 200 characters, and I am actually creating 16 00:01:21,150 --> 00:01:23,980 a file of steam outside. 17 00:01:24,090 --> 00:01:32,430 Here is my fire object, and I'm using this by an object to create a fire look like if I ended up dead. 18 00:01:32,880 --> 00:01:36,100 It is also a file type like explains. 19 00:01:36,120 --> 00:01:36,600 OK. 20 00:01:36,750 --> 00:01:41,930 So if you want, you can change this data and you can always use the SDR. 21 00:01:41,940 --> 00:01:44,580 So that's also that will also work fine. 22 00:01:45,090 --> 00:01:52,070 Now I want to write something into a fire, so I am asking and tell you a name and I am using senior 23 00:01:52,080 --> 00:01:53,100 get line function. 24 00:01:53,310 --> 00:01:56,580 So what happens when you are using not that name function? 25 00:01:56,760 --> 00:02:03,150 It will get that line from the keyboard and it will store that in this regard data. 26 00:02:04,220 --> 00:02:12,980 Now I am using the old object and using the stream insertion operator to write they attached to that 27 00:02:12,980 --> 00:02:19,280 file, so I would fail, then this operator determines it will be writing the data, which I have from 28 00:02:19,280 --> 00:02:25,610 the right to the following year filed our daddy file right. 29 00:02:26,240 --> 00:02:28,070 So then I am asking for it. 30 00:02:28,430 --> 00:02:29,570 This is also similar. 31 00:02:29,930 --> 00:02:34,160 Then it's like inputting that data then. 32 00:02:34,160 --> 00:02:39,260 Now that similarly and then I am closing the open file right here. 33 00:02:39,470 --> 00:02:47,840 I have already discussed the steps one opening the file, then writing the file, then closing the pie. 34 00:02:48,020 --> 00:02:48,380 OK. 35 00:02:48,620 --> 00:02:52,400 Once that disclosed, I want to read the data from the file. 36 00:02:52,640 --> 00:02:55,720 So I am again opening the same file, a file in our debt. 37 00:02:55,940 --> 00:03:03,740 But here I am, using a female object to create a file, object calling file and in file is used to 38 00:03:03,890 --> 00:03:05,410 open my file. 39 00:03:06,530 --> 00:03:08,090 Then I am reading from the file. 40 00:03:08,390 --> 00:03:12,500 Then I'm showing that in fact to data. 41 00:03:12,500 --> 00:03:17,620 So I am reading the data from the file and storing it to all this variable data. 42 00:03:17,640 --> 00:03:21,560 Then I am printing that data again, turning the data. 43 00:03:21,590 --> 00:03:22,310 Second line. 44 00:03:22,640 --> 00:03:29,130 Then I'm writing that to screen, counting that scanning, finally and closing that. 45 00:03:29,570 --> 00:03:31,670 So this is the explanation of the problem. 46 00:03:31,940 --> 00:03:33,080 So any program? 47 00:03:33,260 --> 00:03:34,490 So now let's see. 48 00:03:34,520 --> 00:03:37,640 How would this actually getting worked? 49 00:03:38,180 --> 00:03:49,580 So the plus plus file starts CBP and now we have or file ready are slashing it out and see right into 50 00:03:49,580 --> 00:03:49,940 the file. 51 00:03:49,940 --> 00:03:56,630 We are actually writing to the file and your name and your age 25. 52 00:03:57,050 --> 00:04:01,460 OK, I have the print leading from the front, then printing the data from the back. 53 00:04:01,610 --> 00:04:09,140 So here we have created a file and we have already read and have read and written into that file. 54 00:04:09,410 --> 00:04:10,930 You want to see that back? 55 00:04:11,150 --> 00:04:13,490 Let me open that and be sure to record for you. 56 00:04:13,880 --> 00:04:18,770 Or let me see if I loaded this year, right? 57 00:04:19,040 --> 00:04:21,410 My did daddy's here and bring that. 58 00:04:21,670 --> 00:04:23,780 See, here we have the file, right? 59 00:04:23,990 --> 00:04:25,000 We having that. 60 00:04:25,010 --> 00:04:25,450 What up? 61 00:04:25,460 --> 00:04:30,890 What are the things we have written into that that is there and we have already used it? 62 00:04:31,040 --> 00:04:37,580 So we have created this file data programmatically and we have added the daytime, read the data from 63 00:04:37,580 --> 00:04:39,010 that programmatically. 64 00:04:39,020 --> 00:04:47,320 So now what we have seen on this lecture is how we can create a file programmatically, how we can add 65 00:04:47,330 --> 00:04:53,690 the data or build the data from it programmatically, or how we can write that data and do it programmatically. 66 00:04:53,930 --> 00:04:55,760 Hope you understood this concept. 67 00:04:55,760 --> 00:05:03,500 It's a bit like we are using some inbuilt functions and objects, and based on that, you will be reading, 68 00:05:03,590 --> 00:05:06,710 writing and doing everything from file.