 Hey everybody, it's Brian. I thought we'd do something a little bit different this video. I wanted to address some user feedback I get. I've been getting a lot of really good feedback from these videos, and I appreciate every message, even the negative ones, because they point out what I'm doing wrong. A couple of these I wanted to point out. We're not going to go over my inbox here, but let's just go over a really good one I saw. It was the switch statement. It was solve the switch statement using the if statement. If, well let's say int number equals, let's say 3. Then we say if number equal 1, and let's just c out here. And let's say, we're just going to add this little verbiage in here just so we can see what it is. So if number is equal to 1, then do this. And then there's a command called else if. It must be changed directly after an if statement. And what you guessed is exactly right. It's the same condition as a case statement in a switch. So we can say if number is 2. And I believe we can chain these together. Forgive me, this is kind of a learning experience for both of us. I don't usually use the else if statement because I just don't like the structure. It's just personal preference. And let's actually just put some numbers in here so we can verify which one's actually firing off. Let's compile this. Watch it run. Sure enough it says 3. The number is 3. So that is how you would use the if statement instead of the switch statement. The functionality is almost identical. I just personally prefer the switch statement. You can use either or. Really it depends on your personal preference and the company policies if you're doing this for a living. Another good question I had was on pointers. Somebody asked, well if a pointer, it points to a memory and location. How do you know how big that variable is? For example, int pointer. Typically you say p num, p stands for pointer. Equal new int. Let's just go ahead and delete that before we forget so we don't create a memory leak. Not like anything catastrophic is going to happen. But p num and let's just say this is 22. Now we've got a basic pointer here. You've seen this before. What's going on here? We have an integer type. We're creating a pointer that points to an integer type. Creating a new int out in memory somewhere. I shouldn't say somewhere. It creates it out on the heap or the free store. And then the pointer and memory location. We're assigning that to e22. Now how do we know what's going on here? Let's say c out, p num. Now as you guessed, that will print out the memory location this is stored at. There we go. That's the memory location. Now that's not the entire story. That's why I wanted to cover this. It's not the entire story because remember a variable has a size. How do you know how big that is? It's taking more than one little chunk of memory. It's taking a lot of them. Well how much is a lot? Let's find out. C out, size of, p num. I think this is the right way to do it. Let's find out. I could be wrong. We could get a compiler and I might have to figure this out on the fly. I don't really use size of a whole lot. Nope. It did work correctly. So there is the starting location and you see the size of generated to four. Why is that important? Well what it says is here is the starting location. The compiler knows it's an integer and the integer is a size of four, meaning it's going to take four memory slots. Make sense? Now what's a memory slot? Memory slots a byte. So it's going to take four bytes. That's why you need to declare the type. So basically what the compiler is seeing is four, point or two, and then four. In a nutshell that's what it's seeing. Some of you are going to argue with me? I welcome the arguments. I don't really know if I'm right or wrong. I'll be brutally honest about that. I think it honestly varies from one compiler to the next, how they really see it internally. But that's the basic function of how it works. You create a pointer, you throw it out on the free store, the compiler needs to know the type so it needs to know how much space it's going to allocate. Now to retrieve that value, you pointer to and then the pointer name. And let's just throw an indel in there and run this. And sure enough there's 22. So what we're saying is create a new pointer which holds an integer. The pointer doesn't hold the integer, the memory holds the integer. The pointer points to that location in memory which takes four bytes and it is a number 22. Yes, it looks like it's only two, but that's actually four bytes in memory. That's how that works. Well I'm kind of pressed for time tonight, but thank you for watching. Keep up with that feedback and hope you found this video educational and entertaining.