0:00 What's going on? This is Bucky. Your third C plus plus 0:03 tutorial and in this tutorial I want to go over a little more about printing 0:07 text on the screen. now in the last saw earlier remember that we could use 0:12 that special thing called cout 0:14 which is technically called the output object and the less than less than sign which 0:18 was called 0:19 the stream insertion operator to print out text on the screen. In 0:23 the way we did this is the added double quotes after and whatever we printed out 0:28 in these double quotes. "Boy I love 0:31 bacon". Whatever we put inside those double quotes 0:34 which is print out on the screen. So I go ahead and build and run this 0:38 we saw "boy I love bacon" right on the screen, 0:42 simple enough. But now what I want to go over is 0:45 just a little more about see our in I just want to make sure you guys 0:49 understand how it works 0:50 so each function is made up of these things called 0:54 statements and typically people per one statement 0:57 per line of code and remember all statements and with semicolons 1:01 so say we wanted for now something else on screen well, you would write cout 1:05 less and less than and great something out like 1:09 "and ham" just like that. so you might be thinking alright, I got a feeling I know what this 1:14 can do. 1:14 on the first line is going to print out "boy I love bacon" and on the second one 1:18 is going to print out and am because you know 1:20 that's how it appears in our code so that's what it's gonna 1:23 but we go ahead and build and run this it says "boy I love bacon and ham" 1:28 all on the same line of code. If you are scratching your head and saying alright 1:32 why exactly does it do that. The reason it does that be 1:35 is because when you're using this thing called cout 1:39 it's called printing out into a stream 1:42 and it pretty much takes all your characters and prints 1:46 them out in the same stream so whenever this stream is done 1:49 you're not telling it to move to a new line you're saying 1:52 print out these characters and then stop right at the end of the line 1:57 so then the stream starts printing out an again. You're not telling and you were to 2:02 move to a new line 2:03 computer programs are very picky and they need to be told 2:06 exactly what to do. so in order to move to a new line 2:10 we need to add a special symbol I guess you would say 2:15 and the symbol is this. First of all, you need to add another stream insertion 2:19 operator 2:19 and you can go ahead and write E-N-D-L 2:23 what this means is and line and now 2:26 when we go ahead and build and run it. check what happens. 2:30 It runs. "boy I love bacon" and then it runs 2:34 in line and before your stream insertion operator would be right here 2:38 but now city said in line. and go-ahead and ends this line 2:42 in it moves it to next line. so basically all you have to remember is 2:46 any time you want to move to a new line use the character 2:49 E N D L which is code word for end line 2:52 now ever saying all right, that's easy enough to remember 2:55 so let me go ahead and show you something that might be even easier for 3:00 you 3:00 inside your quotation marks if you go ahead and add 3:04 backslash n, this is basically the same 3:08 is adding a new line backslash n 3:11 is the code, I guess at all it is code, 3:14 for go to a new line so now it's gonna say "boy I love bacon" 3:19 and then it's going to come across this thing called back slash and its can say hold 3:23 on 3:23 what is this special accent. I know what it is. 3:26 it's a simple to move to a new line so this is it 3:30 basically just an alternative way to move to new lines 3:33 the only difference is when "END L" you need to add 3:38 another insertion operator and then write END L right there. 3:41 with the new line you write it inside the quotation marks because 3:45 it gets interpreted and different kinda way so let's go ahead and build run this 3:48 and just verify that. yep, "boy I love bacon" 3:52 new line and ham. so again 3:55 like I said whenever you want print text on a new line you have to be very 3:59 specific with C plus plus 4:01 and tell you exactly what to do and you can do this 4:04 either using the END L or the new line 4:07 that goes inside the quotation marks. so aside from this you might think 4:11 all right. so I print this out and I got 4:14 this on next line. But what if I wanted a blank line in between these two 4:18 well all you have to do is write newline newline 4:22 and then we go ahead and you going to run this. ok, say all right 4:25 "boy I love bacon" newline newline 4:29 and then a printed out and ham. simple enough 4:32 pretty cool huh? and I guess one other thing I can show you is 4:35 if you go ahead and do cout 4:38 insertion operator, um, you can do things like this 4:42 boy newline - I - endline 4:46 love newline bacon 4:50 newline so you know you're not only limited to 4:53 you know one new line per statement. you can have multiple new lines 4:56 in a single statement so now it says 5:00 "boy I love bacon" pretty cool, huh? 5:03 so that's all the basics I wanted for you guys this tutorial again 5:07 I wanted to stress how to print out text on the screen 5:10 and also the stream insertion operator 5:14 it's basically this each stream insertion resumes 5:19 its printing out wherever the previous one stopped. so if you want to move it to a 5:23 new 5:23 line you need to use one in these new line symbols either END L 5:27 or new line so that I have for you guys in this tutorial and now you should be a pro at 5:32 printing text on the screen 5:33 so you know we're not ready to bundle up this program and sell to Microsoft yet 5:38 by hey 5:38 it start. Thank you guys for watchin'. If you have any questions go to my website theNewBoston 5:42 dot com 5:43 and ask me on my forum. so thank you guys for watchin' and 5:47 I guess I see next video