Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated:
1
00:00:00,330 --> 00:00:07,950
All righty, so in this video, we are going to talk about the F put s function and these function works
2
00:00:07,950 --> 00:00:11,880
similarly to the put s function on.
3
00:00:11,880 --> 00:00:21,330
Just to remind you that in the strings section, usually we talk about the dysfunction that works like
4
00:00:21,330 --> 00:00:21,810
this.
5
00:00:21,880 --> 00:00:24,410
OK, so let's get it right here.
6
00:00:24,630 --> 00:00:32,120
Let's say put s, put s and basically get some string and put it to the screen.
7
00:00:32,130 --> 00:00:33,150
In this case, let's go.
8
00:00:33,150 --> 00:00:33,810
Like, I don't know.
9
00:00:33,810 --> 00:00:34,410
Hey man.
10
00:00:36,090 --> 00:00:39,990
And put another string like this is.
11
00:00:41,170 --> 00:00:46,000
This is Vlad from Alphatech, I don't know, something like this.
12
00:00:46,200 --> 00:00:51,270
Okay, guys, so now let's see what will happen if we run these two lines of code.
13
00:00:51,280 --> 00:00:57,790
So let's basically combing these lines out that they will not interfere with our without with our code.
14
00:00:58,450 --> 00:01:00,590
Let's build and run it and see what will happen.
15
00:01:00,610 --> 00:01:03,130
So, hey, man, this is Vlad from Alphatech.
16
00:01:03,820 --> 00:01:10,030
So we got these two strings and we put them to our console application.
17
00:01:10,360 --> 00:01:16,660
OK, so the Buddhist function was used to write strings to the screen.
18
00:01:17,170 --> 00:01:25,060
And similarly, the F puts function that we are talking about right now will you will do pretty much
19
00:01:25,060 --> 00:01:25,570
the same.
20
00:01:26,350 --> 00:01:33,820
Instead of writing the strings to the console application to the screen, it will write them to some
21
00:01:33,820 --> 00:01:34,420
file.
22
00:01:35,170 --> 00:01:40,150
And that's the explanation for additional graphics that we have here.
23
00:01:40,150 --> 00:01:48,460
Are these F OK, this letter F used to specify and we will put a string, OK, these protests, we will
24
00:01:48,460 --> 00:01:53,110
put a string to some file, OK.
25
00:01:53,530 --> 00:01:55,930
And the syntax will look like this.
26
00:01:56,290 --> 00:01:57,730
We will specify the string.
27
00:01:57,730 --> 00:02:04,470
Right, just like here and a pointer to the file where we want to redirect this information.
28
00:02:05,080 --> 00:02:12,550
OK, so once again we provide a string as the first argument that the function simply specifying what
29
00:02:12,550 --> 00:02:15,190
string we want to write to the file.
30
00:02:15,520 --> 00:02:22,270
And as the second argument, we specify the pointer to the relevant file after it has been opened.
31
00:02:22,270 --> 00:02:22,560
Right.
32
00:02:22,600 --> 00:02:23,710
Like previously.
33
00:02:26,110 --> 00:02:27,180
So it clear so far.
34
00:02:27,190 --> 00:02:28,040
Any questions?
35
00:02:28,690 --> 00:02:29,050
Good.
36
00:02:29,200 --> 00:02:36,610
If you have any questions, feel free to ask them in the Q Nothing difficult at all actually are simply
37
00:02:36,610 --> 00:02:39,490
as we've used put s when working with strings.
38
00:02:39,490 --> 00:02:42,420
We will do the same with the output as function.
39
00:02:42,430 --> 00:02:43,930
So let's see how it will look like.
40
00:02:43,940 --> 00:02:52,660
So let's take it f put s f put s in here we will use FP and also here we will use.
41
00:02:53,760 --> 00:02:54,370
F.P..
42
00:02:54,810 --> 00:03:01,830
OK, so let's basically just copy it to the relevant place, and these part will be on comment.
43
00:03:02,770 --> 00:03:04,660
I just want to show you what will happen.
44
00:03:05,290 --> 00:03:07,200
So there you go.
45
00:03:07,210 --> 00:03:07,880
There you go.
46
00:03:07,900 --> 00:03:10,780
OK, so, hey, man, this is Vlad from Alphatech.
47
00:03:10,930 --> 00:03:15,480
And previously we had we had something like this, OK?
48
00:03:15,490 --> 00:03:19,910
It was like it put protest, put protest and without specifying the pointer to the file.
49
00:03:20,610 --> 00:03:21,530
OK, awesome.
50
00:03:21,550 --> 00:03:26,320
So why use both of them is because I want to show you something.
51
00:03:27,370 --> 00:03:31,720
What's going on, what's happening, what is happening?
52
00:03:31,780 --> 00:03:32,590
Let me see.
53
00:03:33,530 --> 00:03:34,460
Oh, never mind.
54
00:03:34,490 --> 00:03:40,100
It was just some small problem, my computer probably got tired by now.
55
00:03:40,110 --> 00:03:44,420
So let's open up this folder of the project and see what it has.
56
00:03:44,810 --> 00:03:48,710
Let me go like here and my first file for There we go.
57
00:03:48,740 --> 00:03:51,170
Hey, man, this is Vlad from Alphatech.
58
00:03:51,560 --> 00:03:55,450
And the question is, why aren't they similar?
59
00:03:55,460 --> 00:03:58,610
So, hey, man, this is from Alphatech in a new line in here.
60
00:03:58,610 --> 00:04:02,690
Everything is basically seems like just in one line.
61
00:04:02,720 --> 00:04:04,550
OK, so why is that?
62
00:04:04,880 --> 00:04:05,570
Why is that?
63
00:04:05,750 --> 00:04:07,310
Let me explain to you.
64
00:04:08,280 --> 00:04:18,090
So simply saying the F put s function does not add a backslash and by default, OK, doesn't add a backslash
65
00:04:18,100 --> 00:04:25,510
and by default at the end of the string, as opposed to how it is being done using the put s function.
66
00:04:25,830 --> 00:04:31,290
So here by default, whenever we use the put his function and then we used to put his function once
67
00:04:31,290 --> 00:04:39,030
again, we can see that there is probably a backslash, an operation backslash and character being added
68
00:04:39,270 --> 00:04:42,930
to the console application that indicates that we will use a new line.
69
00:04:43,290 --> 00:04:49,920
And that's not something that we can see when we are using the F portus function.
70
00:04:50,160 --> 00:04:56,760
OK, just remember that every time that you need to jump to the next line, it will not be done by default
71
00:04:56,970 --> 00:04:59,660
and you will have to specify it explicitly.
72
00:04:59,670 --> 00:05:06,060
So for example, here we will specify backslash N and now we will run it once again.
73
00:05:06,060 --> 00:05:13,050
We will see that this does not interest me, but I'm interested in the file itself that has been created
74
00:05:13,050 --> 00:05:13,410
here.
75
00:05:13,770 --> 00:05:14,500
So let's see.
76
00:05:14,970 --> 00:05:15,960
And there you go.
77
00:05:15,990 --> 00:05:21,030
Hey man, this was blood from Alphatech, so.
78
00:05:21,030 --> 00:05:21,540
Yeah.
79
00:05:21,780 --> 00:05:23,030
Thank you guys for watching.
80
00:05:23,640 --> 00:05:30,410
Pay close attention to the differences between even the subtle things and keep on practicing.
81
00:05:30,420 --> 00:05:34,050
Keep on moving forward and you are bound to succeed.
82
00:05:34,440 --> 00:05:35,430
I'll see you next time.
83
00:05:35,610 --> 00:05:36,120
Thank you.
7433
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.