title
POINTERS in C++
description
Twitter ► https://twitter.com/thecherno
Instagram ► https://instagram.com/thecherno
Patreon ► https://patreon.com/thecherno
Series Playlist ► https://www.youtube.com/playlist?list=PLlrATfBNZ98dudnM48yfGUldqGD0S4FFb
----------------------------------------------------------------------------------------------------------------
BEST laptop for programming! ► http://geni.us/pakTES
My FAVOURITE keyboard for programming! ► http://geni.us/zNhB
My FAVOURITE monitors for programming! ► http://geni.us/Ig6KBq
MAIN Camera ► http://geni.us/CYUQ
MAIN Lens ► http://geni.us/ZM3CmG
Microphone ► http://geni.us/wqO6g7K
----------------------------------------------------------------------------------------------------------------
Slack ► https://slack.thecherno.com
Stream ► http://www.twitch.tv/thecherno
Website ► http://www.thecherno.com
Facebook ► http://www.facebook.com/thecherno
detail
{'title': 'POINTERS in C++', 'heatmap': [{'end': 818.455, 'start': 762.249, 'weight': 0.739}, {'end': 949.058, 'start': 904.596, 'weight': 0.757}], 'summary': 'Covers the importance of c++ pointers in managing and manipulating memory, explaining their nature as integers holding memory addresses, insights into debugging, and the significance of specifying types for proper data handling, with practical examples provided.', 'chapters': [{'end': 307.3, 'segs': [{'end': 52.848, 'src': 'embed', 'start': 25.309, 'weight': 2, 'content': [{'end': 29.191, 'text': "And I also wanna mention that today we'll be talking about raw pointers, not smart pointers.", 'start': 25.309, 'duration': 3.882}, {'end': 31.432, 'text': "If you don't know what smart pointers are, don't worry about that.", 'start': 29.231, 'duration': 2.201}, {'end': 32.732, 'text': "We'll get into that in the future.", 'start': 31.472, 'duration': 1.26}, {'end': 34.073, 'text': 'Computers deal with memory.', 'start': 32.873, 'duration': 1.2}, {'end': 36.474, 'text': 'Memory is everything to a computer.', 'start': 34.153, 'duration': 2.321}, {'end': 41.458, 'text': 'If I had to name, the single most important thing in programming would probably be memory.', 'start': 36.615, 'duration': 4.843}, {'end': 46.603, 'text': 'when you write an application and you launch it, that entire application gets loaded into memory.', 'start': 41.458, 'duration': 5.145}, {'end': 52.848, 'text': "all of the instructions that tell the computer what to do in the code that you've written all of that gets loaded into memory.", 'start': 46.603, 'duration': 6.245}], 'summary': 'Discussion on the importance of memory in programming.', 'duration': 27.539, 'max_score': 25.309, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/DTxHyVn0ODg/pics/DTxHyVn0ODg25309.jpg'}, {'end': 125.229, 'src': 'embed', 'start': 97.454, 'weight': 4, 'content': [{'end': 103.896, 'text': 'If your entire city that you live in just had a single street and there was a start and there was an end, and then you had a bunch of houses.', 'start': 97.454, 'duration': 6.442}, {'end': 105.337, 'text': 'There were no houses across the road.', 'start': 103.936, 'duration': 1.401}, {'end': 109.258, 'text': "Let's just say there's just a street and there's like a row of houses.", 'start': 105.357, 'duration': 3.901}, {'end': 111.679, 'text': 'That is what memory is in a computer.', 'start': 109.838, 'duration': 1.841}, {'end': 114.801, 'text': "It's just a linear one-dimensional line.", 'start': 111.899, 'duration': 2.902}, {'end': 119.084, 'text': 'And every house on that street is going to have a number, an address.', 'start': 115.182, 'duration': 3.902}, {'end': 125.229, 'text': 'So to bring that metaphor back to computers, picture that every house on that street that has an address is a byte.', 'start': 119.345, 'duration': 5.884}], 'summary': 'Memory in a computer is like a one-dimensional line with bytes as addresses.', 'duration': 27.775, 'max_score': 97.454, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/DTxHyVn0ODg/pics/DTxHyVn0ODg97454.jpg'}, {'end': 177.424, 'src': 'embed', 'start': 149.227, 'weight': 0, 'content': [{'end': 154.191, 'text': "It's the address that tells us where that house is, where that specific byte of memory is.", 'start': 149.227, 'duration': 4.964}, {'end': 161.956, 'text': "And that's extremely important because pretty much everything we do in our code is going to be reading or writing from and to memory.", 'start': 154.511, 'duration': 7.445}, {'end': 166.758, 'text': "Now, of course, it's perfectly possible for you in C++ to write an application that does not use pointers.", 'start': 162.196, 'duration': 4.562}, {'end': 168.559, 'text': 'You can do that.', 'start': 167.939, 'duration': 0.62}, {'end': 170.48, 'text': "You don't necessarily need to use pointers.", 'start': 168.759, 'duration': 1.721}, {'end': 177.424, 'text': 'However, they are an extremely useful tool because, as I just mentioned, memory is probably the single most important thing you have,', 'start': 170.54, 'duration': 6.884}], 'summary': 'Pointers in c++ are crucial for memory access and manipulation.', 'duration': 28.197, 'max_score': 149.227, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/DTxHyVn0ODg/pics/DTxHyVn0ODg149227.jpg'}, {'end': 262.933, 'src': 'embed', 'start': 230.489, 'weight': 3, 'content': [{'end': 232.191, 'text': "So let's go ahead and create a pointer.", 'start': 230.489, 'duration': 1.702}, {'end': 236.674, 'text': "We're gonna create the purest of pointers because it's going to be something called a void pointer.", 'start': 232.211, 'duration': 4.463}, {'end': 239.777, 'text': "Void basically means that it's completely typeless.", 'start': 237.535, 'duration': 2.242}, {'end': 243.32, 'text': 'Remember, I said that a pointer is just an address.', 'start': 239.817, 'duration': 3.503}, {'end': 246.462, 'text': "It's just an integer which holds an address in memory.", 'start': 243.46, 'duration': 3.002}, {'end': 247.623, 'text': "So it doesn't need a type.", 'start': 246.602, 'duration': 1.021}, {'end': 254.669, 'text': "If we give a pointer a type, we're just saying that the data at that address is presumed to be the type that we give it, right?", 'start': 247.703, 'duration': 6.966}, {'end': 257.25, 'text': "It doesn't mean anything apart from that.", 'start': 254.749, 'duration': 2.501}, {'end': 262.933, 'text': "It's just something that we can write to make our lives easier, syntactically, like in the actual source code.", 'start': 257.75, 'duration': 5.183}], 'summary': 'Creating a void pointer for typeless addresses in memory.', 'duration': 32.444, 'max_score': 230.489, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/DTxHyVn0ODg/pics/DTxHyVn0ODg230489.jpg'}, {'end': 298.494, 'src': 'embed', 'start': 267.915, 'weight': 1, 'content': [{'end': 269.396, 'text': 'A pointer is just a memory address.', 'start': 267.915, 'duration': 1.481}, {'end': 270.956, 'text': "It's just an integer.", 'start': 269.716, 'duration': 1.24}, {'end': 279.7, 'text': 'So a void pointer means that we do not care right now in our source code what type this actual data is because we just want to really hold an address.', 'start': 271.136, 'duration': 8.564}, {'end': 280.761, 'text': "let's go ahead.", 'start': 280.2, 'duration': 0.561}, {'end': 284.463, 'text': "i'll call it ptr or pointer for short, and i'll set it equal to zero.", 'start': 280.761, 'duration': 3.702}, {'end': 285.244, 'text': 'so what is zero?', 'start': 284.463, 'duration': 0.781}, {'end': 287.806, 'text': "we've given this pointer a memory address of zero.", 'start': 285.244, 'duration': 2.562}, {'end': 288.726, 'text': 'what does that mean?', 'start': 287.806, 'duration': 0.92}, {'end': 291.589, 'text': "well, zero isn't actually a valid memory address.", 'start': 288.726, 'duration': 2.863}, {'end': 294.451, 'text': 'memory addresses do not go all the way down to zero.', 'start': 291.589, 'duration': 2.862}, {'end': 298.494, 'text': 'zero is invalid, and what that means is that this pointer is not valid.', 'start': 294.451, 'duration': 4.043}], 'summary': 'A void pointer holds an invalid memory address, represented by zero.', 'duration': 30.579, 'max_score': 267.915, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/DTxHyVn0ODg/pics/DTxHyVn0ODg267915.jpg'}], 'start': 2.835, 'title': 'C++ pointers', 'summary': 'Covers the importance of pointers in managing and manipulating memory in c++, emphasizing their nature as integers holding memory addresses and the concept of void pointers, with practical examples provided.', 'chapters': [{'end': 191.978, 'start': 2.835, 'title': 'C++ pointers explained', 'summary': 'Covers the importance of pointers in managing and manipulating memory, emphasizing that a pointer is an integer storing a memory address and how memory in a computer can be metaphorically explained as a linear one-dimensional line with each house having an address, relating to bytes of data.', 'duration': 189.143, 'highlights': ['Pointers are crucial in managing and manipulating memory in C++ as they provide the address of specific bytes of memory, enabling reading and writing operations.', 'Describing memory in a computer as a linear one-dimensional line with each house having an address, relating to bytes of data, helps understand the role of pointers as addresses of specific bytes of memory.', 'Emphasizing the central importance of memory in programming, with pointers being a vital tool for more control over memory, as memory is essential for storing all instructions, data, and variables in a computer.']}, {'end': 307.3, 'start': 192.279, 'title': 'Understanding pointers in c++', 'summary': 'Discusses the concept of pointers in c++, emphasizing their nature as integers holding memory addresses and their typelessness, with a focus on void pointers and an example of creating and assigning a void pointer to a memory address of zero.', 'duration': 115.021, 'highlights': ['A pointer is simply an integer that holds a memory address, irrespective of types.', 'Void pointer in C++ is typeless, representing an address without specifying a data type, making it suitable for holding any type of address.', 'Assigning a memory address of zero to a pointer results in an invalid pointer, as zero is not a valid memory address in the context of C++.', 'Understanding that types are just a syntactic convenience and do not change the fundamental nature of a pointer being a memory address.', 'Explanation of the concept of void pointers as typeless and used for holding memory addresses without specifying a data type.']}], 'duration': 304.465, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/DTxHyVn0ODg/pics/DTxHyVn0ODg2835.jpg', 'highlights': ['Pointers are crucial in managing and manipulating memory in C++ as they provide the address of specific bytes of memory, enabling reading and writing operations.', 'A pointer is simply an integer that holds a memory address, irrespective of types.', 'Emphasizing the central importance of memory in programming, with pointers being a vital tool for more control over memory, as memory is essential for storing all instructions, data, and variables in a computer.', 'Void pointer in C++ is typeless, representing an address without specifying a data type, making it suitable for holding any type of address.', 'Describing memory in a computer as a linear one-dimensional line with each house having an address, relating to bytes of data, helps understand the role of pointers as addresses of specific bytes of memory.']}, {'end': 530.768, 'segs': [{'end': 335.979, 'src': 'embed', 'start': 307.32, 'weight': 0, 'content': [{'end': 309.121, 'text': 'If we try and do that our program will crash.', 'start': 307.32, 'duration': 1.801}, {'end': 313.945, 'text': 'So zero means null and we can actually also write it like this which is actually just a hash define.', 'start': 309.381, 'duration': 4.564}, {'end': 318.087, 'text': "If you look up what that null actually is you can see it's just a hash define for zero.", 'start': 313.985, 'duration': 4.102}, {'end': 319.889, 'text': "So it's the same as if we wrote zero.", 'start': 318.107, 'duration': 1.782}, {'end': 322.65, 'text': 'Or we can use a C++ keyword called null pointer.', 'start': 320.189, 'duration': 2.461}, {'end': 324.031, 'text': 'This was introduced in C++11.', 'start': 322.67, 'duration': 1.361}, {'end': 326.473, 'text': "So awesome we've made our first pointer.", 'start': 324.612, 'duration': 1.861}, {'end': 330.135, 'text': 'It is completely typeless and it has the memory address of zero.', 'start': 326.553, 'duration': 3.582}, {'end': 334.038, 'text': "Completely useless but it's a pointer and it's probably the simplest pointer you could write.", 'start': 330.355, 'duration': 3.683}, {'end': 335.979, 'text': "Let's do something a little bit more useful.", 'start': 334.218, 'duration': 1.761}], 'summary': 'Introduction to null pointer in c++11, representing memory address of zero.', 'duration': 28.659, 'max_score': 307.32, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/DTxHyVn0ODg/pics/DTxHyVn0ODg307320.jpg'}, {'end': 371.828, 'src': 'embed', 'start': 342.044, 'weight': 4, 'content': [{'end': 348.569, 'text': 'Now this is just a normal integer, but of course every variable we create has a memory address because we need a place to store that variable.', 'start': 342.044, 'duration': 6.525}, {'end': 352.552, 'text': 'So what if I wanna find out what the memory address of that variable is.', 'start': 348.649, 'duration': 3.903}, {'end': 357.296, 'text': 'So where are you in memory? I can do that by using the ampersand operator.', 'start': 352.572, 'duration': 4.724}, {'end': 365.062, 'text': "So, if I use an ampersand in front of an existing variable like this, we're essentially asking this variable hey, what is your memory address?", 'start': 357.336, 'duration': 7.726}, {'end': 371.828, 'text': "And then, of course, we're taking the memory address of that variable and, in this case, assigning it to a new variable called pointer.", 'start': 365.262, 'duration': 6.566}], 'summary': 'Using ampersand operator to find memory address of a variable.', 'duration': 29.784, 'max_score': 342.044, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/DTxHyVn0ODg/pics/DTxHyVn0ODg342044.jpg'}, {'end': 408.01, 'src': 'embed', 'start': 372.649, 'weight': 1, 'content': [{'end': 377.914, 'text': "We've now got the memory address of our variable and we're storing it in another variable, which is a pointer.", 'start': 372.649, 'duration': 5.265}, {'end': 382.598, 'text': "I'm going to put a breakpoint on this line of code and hit F5 to run and debug my application.", 'start': 378.154, 'duration': 4.444}, {'end': 385.261, 'text': "So right now, if I take a look at what we've got, we've got a variable.", 'start': 382.818, 'duration': 2.443}, {'end': 388.364, 'text': 'You can see if I hover my mouse over it, it has the value of eight.', 'start': 385.281, 'duration': 3.083}, {'end': 391.106, 'text': 'And if I hover my mouse over pointer, it has.', 'start': 388.444, 'duration': 2.662}, {'end': 397.828, 'text': 'a slightly different value which is presented to us in hexadecimal format, but it is, as you can see, still just a number.', 'start': 391.747, 'duration': 6.081}, {'end': 398.648, 'text': "it's an integer.", 'start': 397.828, 'duration': 0.82}, {'end': 404.049, 'text': "so what that pointer variable is holding now is the memory address of that var variable, and that's all.", 'start': 398.648, 'duration': 5.401}, {'end': 408.01, 'text': 'it is that number that you see there a0fb64.', 'start': 404.049, 'duration': 3.961}], 'summary': 'Variable holds value of 8, pointer holds memory address in hexadecimal format.', 'duration': 35.361, 'max_score': 372.649, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/DTxHyVn0ODg/pics/DTxHyVn0ODg372649.jpg'}, {'end': 484.713, 'src': 'embed', 'start': 455.62, 'weight': 2, 'content': [{'end': 457.461, 'text': 'Everything else builds from this.', 'start': 455.62, 'duration': 1.841}, {'end': 461.904, 'text': "If you know this much and you're following me and you're understanding, there's no magic behind it.", 'start': 457.521, 'duration': 4.383}, {'end': 463.005, 'text': "That's how pointers work.", 'start': 461.964, 'duration': 1.041}, {'end': 467.628, 'text': 'an address, an integer.', 'start': 466.187, 'duration': 1.441}, {'end': 469.348, 'text': 'A pointer is like any other variable.', 'start': 467.768, 'duration': 1.58}, {'end': 475.19, 'text': "it's just that instead of holding a value such as A, it's holding a memory address, which a memory address is also a value, it's also an integer.", 'start': 469.348, 'duration': 5.842}, {'end': 480.051, 'text': 'Now, how big that integer is, how big that pointer is, depends on a lot of things.', 'start': 475.45, 'duration': 4.601}, {'end': 481.792, 'text': 'It could be a 32-bit integer.', 'start': 480.111, 'duration': 1.681}, {'end': 484.713, 'text': 'it could be a 64-bit integer, it could be a 16-bit integer.', 'start': 481.792, 'duration': 2.921}], 'summary': 'Pointers hold memory addresses, which can be 32-bit, 64-bit, or 16-bit integers.', 'duration': 29.093, 'max_score': 455.62, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/DTxHyVn0ODg/pics/DTxHyVn0ODg455620.jpg'}], 'start': 307.32, 'title': 'Pointers in c++', 'summary': 'Introduces and explains the concept of pointers in c++, including null pointers, memory address creation and access, and insights into debugging. it also demonstrates how pointers hold memory addresses, visualize in memory, and store values regardless of size or type changes.', 'chapters': [{'end': 372.509, 'start': 307.32, 'title': 'Introduction to pointers in c++', 'summary': 'Introduces the concept of pointers in c++, explaining the use of null pointers, creating and accessing memory addresses, and the introduction of the null pointer in c++11.', 'duration': 65.189, 'highlights': ['Introducing null pointers as a hash define for zero and the C++ keyword called null pointer, which has the memory address of zero and was introduced in C++11.', 'Demonstrating the creation of an integer variable and its associated memory address using the ampersand operator.', 'Explaining the simplicity of a completely typeless pointer with a memory address of zero, labeled as useless but still a pointer.']}, {'end': 432.332, 'start': 372.649, 'title': 'Using pointers in c++', 'summary': 'Explains the concept of pointers in c++, demonstrating how a pointer holds the memory address of a variable and how it can be visualized in memory, providing insights into debugging.', 'duration': 59.683, 'highlights': ['The pointer variable holds the memory address of the var variable, which is presented in hexadecimal format and is essentially an integer.', "The application's memory is visualized, allowing for the examination of the memory contents and the specific location of the integer variable.", "A breakpoint is placed to run and debug the application, providing a real-time demonstration of the pointer's value and the variable's memory address."]}, {'end': 530.768, 'start': 432.472, 'title': 'Understanding pointers in memory', 'summary': 'Explains the concept of pointers in memory, demonstrating how an integer value is stored at a specific memory address and how a pointer can hold a memory address as a value, regardless of its size, while showcasing the ability to change the type of the pointer without altering the stored value.', 'duration': 98.296, 'highlights': ['Pointers hold memory addresses as values, and their size can vary (32-bit, 64-bit, 16-bit), but they are fundamentally integers.', 'Changing the type of a pointer does not affect the stored value, as demonstrated by converting the pointer to a different type and observing that the stored value remains unchanged.', 'The chapter emphasizes that understanding how an integer value is stored at a memory address forms the foundation of comprehending pointers and their functionality.']}], 'duration': 223.448, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/DTxHyVn0ODg/pics/DTxHyVn0ODg307320.jpg', 'highlights': ['Introducing null pointers as a hash define for zero and the C++ keyword called null pointer, which has the memory address of zero and was introduced in C++11.', 'The pointer variable holds the memory address of the var variable, which is presented in hexadecimal format and is essentially an integer.', 'Pointers hold memory addresses as values, and their size can vary (32-bit, 64-bit, 16-bit), but they are fundamentally integers.', "A breakpoint is placed to run and debug the application, providing a real-time demonstration of the pointer's value and the variable's memory address.", 'Demonstrating the creation of an integer variable and its associated memory address using the ampersand operator.']}, {'end': 1000.809, 'segs': [{'end': 555.545, 'src': 'embed', 'start': 531.008, 'weight': 0, 'content': [{'end': 536.792, 'text': "It takes me to that place in memory where I'm storing my data and there are four bytes there that have the value eight.", 'start': 531.008, 'duration': 5.784}, {'end': 538.654, 'text': 'Types do not matter.', 'start': 537.072, 'duration': 1.582}, {'end': 541.896, 'text': 'Types are useful for manipulation of that memory.', 'start': 539.014, 'duration': 2.882}, {'end': 547.379, 'text': 'So if I want to read and write to, that memory types can help me out, because the compiler will know, for example,', 'start': 542.196, 'duration': 5.183}, {'end': 549.141, 'text': 'that an integer is supposed to be four bytes.', 'start': 547.379, 'duration': 1.762}, {'end': 552.963, 'text': 'So when I try and set a value there, it will set four bytes of memory.', 'start': 549.461, 'duration': 3.502}, {'end': 555.545, 'text': 'But ultimately, types are completely meaningless.', 'start': 553.243, 'duration': 2.302}], 'summary': 'Memory has four bytes with value eight, types aid memory manipulation, but ultimately meaningless.', 'duration': 24.537, 'max_score': 531.008, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/DTxHyVn0ODg/pics/DTxHyVn0ODg531008.jpg'}, {'end': 612.897, 'src': 'embed', 'start': 586.295, 'weight': 1, 'content': [{'end': 590.198, 'text': "So we've gone from a var to a pointer to var.", 'start': 586.295, 'duration': 3.903}, {'end': 596.784, 'text': 'But how do I come back to that var? Well, you can do that by sticking an asterisk at the front of your pointer.', 'start': 590.538, 'duration': 6.246}, {'end': 603.73, 'text': "So in other words, if I write this, I'm actually dereferencing that pointer, which means that I'm now accessing the data.", 'start': 597.004, 'duration': 6.726}, {'end': 606.953, 'text': 'I can either read from or write to that data.', 'start': 603.81, 'duration': 3.143}, {'end': 609.936, 'text': 'So I could, for example, write the value 10 in here.', 'start': 607.153, 'duration': 2.783}, {'end': 612.897, 'text': "However, if I try and do that, you'll see that I'm actually getting an error.", 'start': 610.296, 'duration': 2.601}], 'summary': 'Dereferencing a pointer allows accessing data, but writing to it may cause errors.', 'duration': 26.602, 'max_score': 586.295, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/DTxHyVn0ODg/pics/DTxHyVn0ODg586295.jpg'}, {'end': 818.455, 'src': 'heatmap', 'start': 762.249, 'weight': 0.739, 'content': [{'end': 766.27, 'text': 'I want you to allocate some memory for me and I want it to be a certain size.', 'start': 762.249, 'duration': 4.021}, {'end': 769.732, 'text': 'So what I could do for now is use a char star.', 'start': 766.431, 'duration': 3.301}, {'end': 773.013, 'text': 'Now we know that a char is one byte, right?', 'start': 769.812, 'duration': 3.201}, {'end': 778.956, 'text': "So when I ask something like this, I'll call it a buffer and I'll set it equal to a new char of size eight.", 'start': 773.394, 'duration': 5.562}, {'end': 781.957, 'text': "What I'm really asking for is eight bytes of memory.", 'start': 779.256, 'duration': 2.701}, {'end': 789.721, 'text': 'So this has allocated eight bytes of memory for us and is returning a pointer to the beginning of that block of memory.', 'start': 782.198, 'duration': 7.523}, {'end': 795.383, 'text': 'I could then use a function called memset, which basically fills the block of memory with data that we specify.', 'start': 789.921, 'duration': 5.462}, {'end': 799.904, 'text': 'It takes in a pointer, which is going to be the pointer to the beginning of the block of memory.', 'start': 795.583, 'duration': 4.321}, {'end': 803.765, 'text': "It's going to take in a value such as zero, and then it's going to take in a size.", 'start': 799.924, 'duration': 3.841}, {'end': 807.766, 'text': 'So how many bytes should it fill? In this case, we know that we have eight bytes.', 'start': 803.805, 'duration': 3.961}, {'end': 809.127, 'text': "Let's run this program.", 'start': 808.286, 'duration': 0.841}, {'end': 810.528, 'text': "And I'm going to take this.", 'start': 809.147, 'duration': 1.381}, {'end': 813.15, 'text': "Now you'll see that this has the memory address over here.", 'start': 810.568, 'duration': 2.582}, {'end': 815.092, 'text': 'Now you already know how memory addresses work and all that.', 'start': 813.23, 'duration': 1.862}, {'end': 818.455, 'text': "So I'm just going to type the actual variable name buffer up here and hit enter.", 'start': 815.112, 'duration': 3.343}], 'summary': 'Allocated 8 bytes of memory using char star and filled it with data using memset.', 'duration': 56.206, 'max_score': 762.249, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/DTxHyVn0ODg/pics/DTxHyVn0ODg762249.jpg'}, {'end': 949.058, 'src': 'heatmap', 'start': 904.596, 'weight': 0.757, 'content': [{'end': 906.978, 'text': "this is the value of pointer i'm going to take that.", 'start': 904.596, 'duration': 2.382}, {'end': 909.64, 'text': "i'm going to copy it in here right now.", 'start': 906.978, 'duration': 2.662}, {'end': 910.82, 'text': 'you can see that over here.', 'start': 909.64, 'duration': 1.18}, {'end': 915.123, 'text': "we've got b8 f1, zero two and zero, zero, four bytes.", 'start': 910.82, 'duration': 4.303}, {'end': 924.389, 'text': "i know that this pointer is going to be four bytes of memory because i'm running a 32-bit application and in a 32-bit application a memory address is 32 bits.", 'start': 915.123, 'duration': 9.266}, {'end': 925.53, 'text': 'more on that in another video.', 'start': 924.389, 'duration': 1.141}, {'end': 929.775, 'text': "Now, because of the endiness of this computer, it's actually in reverse order.", 'start': 926.09, 'duration': 3.685}, {'end': 938.126, 'text': 'So if I paste this in here, we actually have to rearrange it so that it says 00, 02, F1, and then B8 at the end, like that.', 'start': 929.815, 'duration': 8.311}, {'end': 944.513, 'text': "If I hit enter, Look at that, I'm taken to the memory which stores this buffer of zeros.", 'start': 938.166, 'duration': 6.347}, {'end': 946.776, 'text': "Okay? That's it.", 'start': 945.134, 'duration': 1.642}, {'end': 949.058, 'text': 'Pointers to pointers, sorted.', 'start': 947.356, 'duration': 1.702}], 'summary': 'Analyzing a 32-bit pointer value, rearranging endianness, and accessing memory buffer.', 'duration': 44.462, 'max_score': 904.596, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/DTxHyVn0ODg/pics/DTxHyVn0ODg904596.jpg'}, {'end': 974.997, 'src': 'embed', 'start': 951.8, 'weight': 2, 'content': [{'end': 958.807, 'text': "I could keep talking about this all day, but really I'm just gonna come back to saying that pointers are just integers which store a memory address.", 'start': 951.8, 'duration': 7.007}, {'end': 960.027, 'text': 'That is all that they are.', 'start': 959.107, 'duration': 0.92}, {'end': 961.608, 'text': 'Get that into your head.', 'start': 960.287, 'duration': 1.321}, {'end': 968.073, 'text': "I'm going to be making a lot more videos on this topic and dealing with things like pointer arithmetic and more advanced kind of pointer operations.", 'start': 961.849, 'duration': 6.224}, {'end': 970.174, 'text': "So if you're new to this channel, feel free to subscribe.", 'start': 968.093, 'duration': 2.081}, {'end': 974.997, 'text': 'As you begin to use pointers and as we begin to use pointers throughout this series,', 'start': 970.534, 'duration': 4.463}], 'summary': 'Pointers are integers storing memory addresses; more videos on pointer operations coming up.', 'duration': 23.197, 'max_score': 951.8, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/DTxHyVn0ODg/pics/DTxHyVn0ODg951800.jpg'}], 'start': 531.008, 'title': 'Understanding memory and pointers in c', 'summary': 'Delves into memory storage, void pointers, and the importance of types in c programming, emphasizing the significance of specifying types for proper data handling. it also explains the concept of pointers, demonstrating their role in accessing and manipulating memory, including heap allocation and the creation of double pointers, while emphasizing their simplicity and potential for advanced operations.', 'chapters': [{'end': 664.469, 'start': 531.008, 'title': 'Understanding memory and void pointers', 'summary': 'Explores memory storage, void pointers, dereferencing, and the importance of types in c programming, highlighting how types dictate memory allocation and data manipulation, emphasizing the significance of specifying types for proper data handling.', 'duration': 133.461, 'highlights': ['The importance of types in C programming is emphasized, as they dictate memory allocation and data manipulation, ensuring the compiler knows how to handle the data; for example, an integer is supposed to be four bytes.', 'The concept of dereferencing is explained, demonstrating how to access and modify data through a pointer, with the use of an asterisk to dereference the pointer, enabling reading from or writing to the data.', 'The significance of specifying types for proper data handling is highlighted, as the example of changing a void pointer to an integer type demonstrates the need to inform the compiler about the data type for correct memory allocation and manipulation.', 'The potential errors that can arise from improper type specification are discussed, emphasizing the importance of accurately informing the compiler about the data type to avoid misunderstandings and ensure correct data handling.']}, {'end': 1000.809, 'start': 664.469, 'title': 'Understanding pointers and memory allocation', 'summary': 'Explains the concept of pointers, demonstrating their role in accessing and manipulating memory, including heap allocation and the creation of double pointers, while emphasizing their simplicity and potential for advanced operations in future videos.', 'duration': 336.34, 'highlights': ['Pointers are integers storing memory addresses, used to access and manipulate data in memory.', "Heap allocation involves requesting memory from the system, demonstrated through the example of allocating eight bytes of memory using 'char star' and filling it with data using 'memset'.", 'Creation and usage of double pointers are explained, showcasing the concept of a pointer to a pointer and its practical application in accessing memory.']}], 'duration': 469.801, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/DTxHyVn0ODg/pics/DTxHyVn0ODg531008.jpg', 'highlights': ['The importance of types in C programming is emphasized, as they dictate memory allocation and data manipulation, ensuring the compiler knows how to handle the data; for example, an integer is supposed to be four bytes.', 'The concept of dereferencing is explained, demonstrating how to access and modify data through a pointer, with the use of an asterisk to dereference the pointer, enabling reading from or writing to the data.', 'Pointers are integers storing memory addresses, used to access and manipulate data in memory.', 'The significance of specifying types for proper data handling is highlighted, as the example of changing a void pointer to an integer type demonstrates the need to inform the compiler about the data type for correct memory allocation and manipulation.']}], 'highlights': ['Pointers are crucial in managing and manipulating memory in C++ as they provide the address of specific bytes of memory, enabling reading and writing operations.', 'Emphasizing the central importance of memory in programming, with pointers being a vital tool for more control over memory, as memory is essential for storing all instructions, data, and variables in a computer.', 'The importance of types in C programming is emphasized, as they dictate memory allocation and data manipulation, ensuring the compiler knows how to handle the data; for example, an integer is supposed to be four bytes.', 'The concept of dereferencing is explained, demonstrating how to access and modify data through a pointer, with the use of an asterisk to dereference the pointer, enabling reading from or writing to the data.', 'Void pointer in C++ is typeless, representing an address without specifying a data type, making it suitable for holding any type of address.']}