1 00:00:00,060 --> 00:00:07,410 So if I am translating all that, things will be arranged like this and I will be starting from the 2 00:00:07,680 --> 00:00:08,730 beginning in that fight. 3 00:00:09,000 --> 00:00:11,790 OK, so that's it on that topic. 4 00:00:11,790 --> 00:00:19,530 Now moving to the read and write to a file mechanism so you can read from a file or write to the file. 5 00:00:19,860 --> 00:00:26,220 So while doing C++ programming, if you want to write information to a file, then you will be using 6 00:00:26,220 --> 00:00:29,040 this operate upstream insertion operator. 7 00:00:29,400 --> 00:00:36,780 And if you want to read from, in fact, you will be using steam extraction. 8 00:00:36,990 --> 00:00:43,110 Operator That means you are getting the value from the key or a keyboard. 9 00:00:43,110 --> 00:00:50,590 Similar to that, you are reading that fire information and writing it to this screen right now to process 10 00:00:50,610 --> 00:00:50,730 by. 11 00:00:50,730 --> 00:00:51,810 And it's very simple. 12 00:00:51,990 --> 00:00:54,150 You can just use this function. 13 00:00:54,420 --> 00:00:55,970 Roy Glass. 14 00:00:56,550 --> 00:01:04,890 Now we do have some more things to cover oneness and other handling files or checking for failure in 15 00:01:04,890 --> 00:01:05,460 finance. 16 00:01:05,790 --> 00:01:11,760 So suppose I if I am opening a file, then some sometimes that file may not get to open. 17 00:01:12,030 --> 00:01:14,940 And there that is a Jansa era is coming. 18 00:01:15,330 --> 00:01:22,320 So if I'm not able to open a file or if I'm not able to write you a file, similar kind of a task and 19 00:01:22,320 --> 00:01:25,230 occurs with or covered files in C++. 20 00:01:25,530 --> 00:01:36,390 So in order to handle those things, we are using some clauses or some integers or flags like these. 21 00:01:36,630 --> 00:01:42,810 So these are the names of some file handling flags, and you can check the value of these flags and 22 00:01:42,810 --> 00:01:46,890 get to see if the file has any kind of at us. 23 00:01:47,160 --> 00:01:50,590 So if the EOI. 24 00:01:51,240 --> 00:01:57,360 So all these things are actually already defined inside the program, so you can just see all this and 25 00:01:57,360 --> 00:02:05,370 see that's an exercise for you again, after creating it by writing some things to it, you can try 26 00:02:05,400 --> 00:02:07,500 coding each of these bits. 27 00:02:07,950 --> 00:02:11,080 Just write code and see what will happen. 28 00:02:11,130 --> 00:02:18,330 So what will be the meaning of this if you're a bit equal to one, if you are still doing that and you 29 00:02:18,330 --> 00:02:23,250 are getting one, then that means the end of violence reached. 30 00:02:23,430 --> 00:02:27,840 That file was completed reading or writing and the hours that end of the fight. 31 00:02:28,020 --> 00:02:33,610 If it is zero, it means like we are not in the end of the fire and fail. 32 00:02:33,670 --> 00:02:39,780 But if there is any kind of input output error and we cannot write something for the file or reading 33 00:02:39,780 --> 00:02:47,000 something from the file, then this failed will be said to one OK and bad, which also is same. 34 00:02:47,370 --> 00:02:51,240 But it set fact an input output, a critical error. 35 00:02:51,390 --> 00:02:53,190 And this is not that, let's put it together. 36 00:02:53,370 --> 00:03:02,550 That's the difference between very good and bad, and it's like having zero value when the file is actually 37 00:03:02,880 --> 00:03:08,790 read, read or write successfully, then the value will be zero. 38 00:03:09,090 --> 00:03:16,710 Now we do have some more useful functions in file, so you can refer to this slide for that. 39 00:03:17,130 --> 00:03:25,080 And you can see, like if I am inside a file, the problem is like we are not able to see anything in 40 00:03:25,080 --> 00:03:25,530 the file. 41 00:03:25,560 --> 00:03:31,770 So if I am opening a file which is already written and these were the key words of the file. 42 00:03:32,280 --> 00:03:36,960 Let me give welcome to happy learning. 43 00:03:38,160 --> 00:03:45,180 So this was the content inside my files, and if I have opened the file, then there is a chance that 44 00:03:45,180 --> 00:03:47,490 my God, a set is somewhat higher here. 45 00:03:48,000 --> 00:03:55,290 So last and I have closed the file by reading until all in this line. 46 00:03:55,830 --> 00:03:57,510 Then my concern will be here. 47 00:03:57,570 --> 00:03:58,940 It will be saved, right? 48 00:03:59,250 --> 00:04:01,680 But the problem is this file. 49 00:04:01,710 --> 00:04:05,880 We are not able to see this file unless we print out of the fight. 50 00:04:06,120 --> 00:04:14,670 So in order to know the position of the binder current position of the blind at the and or like if you 51 00:04:14,670 --> 00:04:21,840 want to move the blind at the beginning or to the end, depending on our use case, how you like and 52 00:04:21,840 --> 00:04:25,950 probably I want to read the file from the beginning, like, welcome to happy learning. 53 00:04:26,310 --> 00:04:29,460 But what will happen if my point I was in this position? 54 00:04:29,700 --> 00:04:37,140 Only the content from this position that is on me to learnings will be getting to me right. 55 00:04:37,440 --> 00:04:43,560 So in order to read that and to move this blind at the beginning or end on an item, you want a lot 56 00:04:43,560 --> 00:04:46,760 of special functions in this programming. 57 00:04:47,070 --> 00:04:49,170 So those are actually discussed over here. 58 00:04:49,290 --> 00:04:56,850 So DLP means it will give me the current position of that binder and belge means it will get me the 59 00:04:56,850 --> 00:04:58,850 composition of that get binder. 60 00:04:58,860 --> 00:04:59,600 So that is like. 61 00:04:59,700 --> 00:05:06,000 Do buying this one is get behind it and why not put behind it, get by and that is actually used for 62 00:05:06,210 --> 00:05:12,750 reading purposes and put Binder is used for writing purposes, so they are to organize this one for 63 00:05:12,750 --> 00:05:14,760 reading and one for writing. 64 00:05:14,760 --> 00:05:16,740 Let it with this be get binder. 65 00:05:16,920 --> 00:05:18,660 And this we put Binder. 66 00:05:18,810 --> 00:05:24,390 Then if I'm starting to read the file from here, then it will be like, Welcome to happy landings. 67 00:05:24,600 --> 00:05:30,720 But if I'm starting to write the fly, it actually, if I'm trying to change that, I'll use it will 68 00:05:30,720 --> 00:05:32,250 actually come from here. 69 00:05:32,670 --> 00:05:33,540 So that's it. 70 00:05:33,900 --> 00:05:36,600 Then see, we will help you do that. 71 00:05:36,600 --> 00:05:39,030 Put Binder to specify a location. 72 00:05:39,300 --> 00:05:40,800 This is the syntax of that. 73 00:05:41,250 --> 00:05:46,620 CMG will help you to move the function like move up, get behind it. 74 00:05:46,620 --> 00:05:48,210 But that desired location. 75 00:05:48,510 --> 00:05:56,460 So what means it, like a single character file and get means it reads as single character from me. 76 00:05:57,300 --> 00:06:00,060 And there are a lot of other operating models. 77 00:06:00,420 --> 00:06:06,210 Big Eyes Big will help you to read from the beginning of the file or right from the beginning of the 78 00:06:06,210 --> 00:06:06,540 file. 79 00:06:06,790 --> 00:06:14,580 Askren will return the current position of the blind US and iOS and will help you to reach that end 80 00:06:14,580 --> 00:06:15,270 of that file. 81 00:06:15,510 --> 00:06:18,330 OK, you can start from then read or write.