0:00 what's going on guys? welcome back to the fourth c plus plus a tutorial and 0:04 in the store, I'm gonna be going over something called variables because 0:08 variables are such huge 0:11 part of C plus plus I can't stress this enough. So, let's go ahead and tap into 0:15 our memory banks 0:16 and try to remember back in like 7th grade when you first start learning 0:20 about 0:21 variables and if you can remember let me give you a brief history lesson 0:25 variables are basically just place orders 0:29 thats all they are so ask go ahead and say we had a very poor 0:33 name X and we said equal to bacon 0:36 well then whenever we would have a sentence like bucky 0:39 loves X we knew that X because bacon said this man 0:44 bucky loves bacon simple enough so let me be guys another quick example say X 0:49 was equal to 0:50 7 so then when we had a statement like 0:53 5 plus axe we know that this man 5 0:57 plus 7 simple enough so as you can see 1:00 a variable is basically just a place order 1:04 now let me go ahead and shake us how to make 1:07 variables in C pas plus and C plus plus 1:10 in order to make variables you go ahead in first grade 1:14 type variable you're gonna be working with now I'm gon be going over data 1:18 types 1:19 later but for now I want to give the as one data typing that's I 1:23 an T this stands for integer and and injures pretty much like a whole number 1:27 like six 1:28 83 540 is a number without a decimal place 1:32 so now that you gave c plus plus 1:35 type up daddy you can be working with you need to go ahead and name your 1:39 variable 1:40 go ahead in a min anything you want I'm no head in a mind to know 1:43 somehow has a type and the name 1:47 so now all we have to do is used the equal sign and set it equal to a value 1:52 so says a Sikh has to be go to a whole number but said equal to 6% 1:56 arm it doesn't matter what ornery said equal to book acts like six 2:00 it's easier to type so now we have the variable tuna 2:04 and she passed person knows that it's an integer 2:07 and it's equal to the value of six so now what can we do with variables 2:12 or just like we can print out tax on the screen we can also print out 2:15 variables just as easy so if you wanna head and said see out 2:19 and just go ahead and print out tuna we can go ahead and build and run this 2:25 and it would print now not to work tuna but it would print out 2:29 6 just like that so that's pretty cool and that's the basics 2:32 variables and how we can use variables 2:36 c plus plus and actually in this is 40 hours planning on doing 2:41 is building a simple calculator arm 2:44 let me go ahead and I guess have time for this 2:47 let's go ahead and make two variables and I'll show you guys 2:51 another cool thing they can do the C pas plus let's go ahead and make 2:54 aunt will call make a verbal called a in all city 2:58 24 let's go ahead and make another variable called be 3:02 which is of course an integer because it's only type we know right now 3:05 and offset the sequel to you know 21 or something doesn't matter as long as 3:09 you're both numbers 3:09 now let's go ahead and make another variable 3:13 called some and thus some is going to be equal to 3:17 a plus be so now you can see 3:21 aside from osco head and yeah 3:25 as gonna so now you can see there aside from just 3:28 assigning variables numbers just like that 3:32 you can also use basic arithmetic to set 3:36 variables eager to another value as well so now the value of 25 3:40 a poss be is going to be equal to some 3:43 so now if you go ahead and print out see out some 3:49 and then go ahead and build and run this check it out 3:52 prints out twenty 5 on-screen pretty cool hot 3:56 so again in the store I want to show you guys that 3:59 in order to make variables go ahead and write the data type 4:03 what do you want the name pair both org sees me what you want the name of the 4:07 variable to be 4:08 and while you want the value variable to be 4:11 and then aside from just assigning variables basic values 4:15 you can also use basic arithmetic like a poss be 4:19 on B-minus a could done that on 4:22 see if he had be minus a as go ahead and see what the value that is 4:28 17 so again in go ahead and set variables equal to 4:33 basic arithmetic using other variables and you can even 4:36 do this some Eagles 48 minus 4:40 arm 7 again this is a really some anymore 4:44 it's Marv AR prod as not the product 4:48 not the quotient the difference there we go that's why 4:53 hand area I got it so again 4:57 you understand the basics are variables that's what I'm trying to stress on the 5:00 next oral 5:01 one can be doing is I'm gonna be showing us how to make a very 5:04 basic calculator and this is the first programmer can be building 5:09 actually interact with the user and it's gonna be awesome 5:12 and you needed to understand variables before I could show that TI so 5:16 that's why I had to go over this store for now thank yasser watchin 5:19 doc subscribe enough a check on my watch said the new bus in a cop 5:23 it's awesome so anyway stink ass Russian and I'll see next video