title
1.4 Pointers and Arrays | Data structure Tutorials
description
Discussed the relationship between Arrays and Pointers in Data Structure with example and code.
DSA Full Course: https: https://www.youtube.com/playlist?list=PLdo5W4Nhv31bbKJzrsKfMpo_grxuLl8LU
******************************************
See Complete Playlists:
C Programming Course: https://www.youtube.com/playlist?list=PLdo5W4Nhv31a8UcMN9-35ghv8qyFWD9_S
C++ Programming: https://www.youtube.com/playlist?list=PLdo5W4Nhv31YU5Wx1dopka58teWP9aCee
Python Full Course: https://www.youtube.com/playlist?list=PLdo5W4Nhv31bZSiqiOL5ta39vSnBxpOPT
Printing Pattern in C: https://www.youtube.com/playlist?list=PLdo5W4Nhv31Yu1igxTE2x0aeShbKtVcCy
DAA Course: https://www.youtube.com/playlist?list=PLdo5W4Nhv31ZTn2P9vF02bkb3SC8uiUUn
Placement Series: https://www.youtube.com/playlist?list=PLdo5W4Nhv31YvlDpJhvOYbM9Ap8UypgEy
Dynamic Programming: https://www.youtube.com/playlist?list=PLdo5W4Nhv31aBrJE1WS4MR9LRfbmZrAQu
Operating Systems: //www.youtube.com/playlist?list=PLdo5W4Nhv31a5ucW_S1K3-x6ztBRD-PNa
DBMS: https://www.youtube.com/playlist?list=PLdo5W4Nhv31b33kF46f9aFjoJPOkdlsRc
*********************************************
Connect & Contact Me:
Facebook: https://www.facebook.com/Jennys-Lectures-CSIT-Netjrf-316814368950701/
Quora: https://www.quora.com/profile/Jayanti-Khatri-Lamba
Instagram: https://www.instagram.com/jayantikhatrilamba/
#pointers
#array
#pointersandarray
#datastructure
#DSA
detail
{'title': '1.4 Pointers and Arrays | Data structure Tutorials', 'heatmap': [{'end': 1119.357, 'start': 1065.674, 'weight': 0.826}, {'end': 1464.086, 'start': 1444.3, 'weight': 0.799}], 'summary': 'Tutorial covers array representation, pointer and array relationship, pointer operations, pointer arithmetic, array addressing, and emphasizes the importance of practice in programming. it includes practical examples and explanations of memory allocation, dereferencing, and pointer arithmetic in c.', 'chapters': [{'end': 62.258, 'segs': [{'end': 25.231, 'src': 'embed', 'start': 0.009, 'weight': 0, 'content': [{'end': 4.873, 'text': 'or you can say that array name is itself a pointer, simple array name.', 'start': 0.009, 'duration': 4.864}, {'end': 7.695, 'text': 'it will act as a pointer.', 'start': 4.873, 'duration': 2.822}, {'end': 15.401, 'text': 'fine, see, i have already discussed how arrays can be represented in memory and how arrays can be declared and initialized.', 'start': 7.695, 'duration': 7.706}, {'end': 16.682, 'text': 'so let us take one example.', 'start': 15.401, 'duration': 1.281}, {'end': 21.289, 'text': 'see, this is what initialization of array.', 'start': 19.488, 'duration': 1.801}, {'end': 25.231, 'text': 'at compile time i have declared one array, a of data type int.', 'start': 21.289, 'duration': 3.942}], 'summary': 'Array name acts as a pointer, representing int data type array at compile time.', 'duration': 25.222, 'max_score': 0.009, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/4Rll-_e9-0M/pics/4Rll-_e9-0M9.jpg'}, {'end': 73.605, 'src': 'embed', 'start': 45.805, 'weight': 1, 'content': [{'end': 48.407, 'text': 'that this thing i have already discussed in the previous video.', 'start': 45.805, 'duration': 2.602}, {'end': 49.628, 'text': 'you can check out that video.', 'start': 48.407, 'duration': 1.221}, {'end': 55.092, 'text': "in that i button fine and i'll provide you the link in the description box also, you can check out there.", 'start': 49.628, 'duration': 5.464}, {'end': 59.495, 'text': 'so if the base address memory manager has assigned the base address to array, that is 100.', 'start': 55.092, 'duration': 4.403}, {'end': 62.258, 'text': 'so next element address for next element would be 104,', 'start': 59.495, 'duration': 2.763}, {'end': 70.083, 'text': 'because the size of integer is 4 bytes in typical compilers fine and index of array should be start from 0.', 'start': 62.258, 'duration': 7.825}, {'end': 73.605, 'text': 'so this is a of 0, 1, 2, 3 and 4..', 'start': 70.083, 'duration': 3.522}], 'summary': 'Memory manager assigns base address 100 to array, with next element at 104, due to integer size of 4 bytes and array index starting from 0.', 'duration': 27.8, 'max_score': 45.805, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/4Rll-_e9-0M/pics/4Rll-_e9-0M45805.jpg'}], 'start': 0.009, 'title': 'Array representation in memory', 'summary': 'Explains the representation of arrays in memory, covering initialization, declaration, and automatic memory allocation. it includes an example of an array of size 5 and base address 100.', 'chapters': [{'end': 62.258, 'start': 0.009, 'title': 'Array representation in memory', 'summary': 'Explains the representation of arrays in memory, including initialization, declaration, and automatic memory allocation, with an example of an array of size 5 and base address 100.', 'duration': 62.249, 'highlights': ['The chapter discusses how arrays can be declared and initialized, using an example of an array of data type int and size 5, with automatic memory allocation for elements.', 'It explains the representation of the array in memory, detailing the base address assignment and the subsequent element addresses.']}], 'duration': 62.249, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/4Rll-_e9-0M/pics/4Rll-_e9-0M9.jpg', 'highlights': ['The chapter discusses how arrays can be declared and initialized, using an example of an array of data type int and size 5, with automatic memory allocation for elements.', 'It explains the representation of the array in memory, detailing the base address assignment and the subsequent element addresses.']}, {'end': 438.46, 'segs': [{'end': 84.672, 'src': 'embed', 'start': 62.258, 'weight': 1, 'content': [{'end': 70.083, 'text': 'because the size of integer is 4 bytes in typical compilers fine and index of array should be start from 0.', 'start': 62.258, 'duration': 7.825}, {'end': 73.605, 'text': 'so this is a of 0, 1, 2, 3 and 4..', 'start': 70.083, 'duration': 3.522}, {'end': 79.949, 'text': "so now see, before going to the relationship of this arrays and pointers, i'm going to tell you how pointers can be declared.", 'start': 73.605, 'duration': 6.344}, {'end': 84.672, 'text': "first of all we'll write the data type, then this s trick and then name of the pointer.", 'start': 79.949, 'duration': 4.723}], 'summary': 'Integers are 4 bytes, array index starts at 0, explaining pointer declaration.', 'duration': 22.414, 'max_score': 62.258, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/4Rll-_e9-0M/pics/4Rll-_e9-0M62258.jpg'}, {'end': 139.884, 'src': 'embed', 'start': 110.877, 'weight': 2, 'content': [{'end': 118.702, 'text': 'so pointer always stores address of another variable and address is always in the form of hexadecimal form.', 'start': 110.877, 'duration': 7.825}, {'end': 121.103, 'text': "it's a long hexadecimal number.", 'start': 118.962, 'duration': 2.141}, {'end': 130.35, 'text': 'so here you can say this pointer p contains address of a variable, fine, and the data type of that variable is integer.', 'start': 121.103, 'duration': 9.247}, {'end': 132.571, 'text': 'so it is a pointer to integer.', 'start': 130.35, 'duration': 2.221}, {'end': 135.073, 'text': 'it is not an integer pointer same.', 'start': 132.571, 'duration': 2.502}, {'end': 139.884, 'text': 'if you write float star, suppose pointer name is q.', 'start': 135.073, 'duration': 4.811}], 'summary': 'Pointers store variable addresses in hexadecimal form, like integer pointer to a variable.', 'duration': 29.007, 'max_score': 110.877, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/4Rll-_e9-0M/pics/4Rll-_e9-0M110877.jpg'}, {'end': 247.89, 'src': 'embed', 'start': 197.38, 'weight': 3, 'content': [{'end': 198.22, 'text': 'so these are bytes.', 'start': 197.38, 'duration': 0.84}, {'end': 199.801, 'text': 'every byte is having its own address.', 'start': 198.22, 'duration': 1.581}, {'end': 205.405, 'text': 'so somewhere in the memory, suppose at address 200, this b value has been stored, that is 10.', 'start': 199.801, 'duration': 5.604}, {'end': 206.206, 'text': 'this is b value.', 'start': 205.405, 'duration': 0.801}, {'end': 211.534, 'text': 'so now this for this pointer, also somewhere this pointer is also stored in memory.', 'start': 207.406, 'duration': 4.128}, {'end': 213.639, 'text': 'so let us take this case.', 'start': 211.534, 'duration': 2.105}, {'end': 222.092, 'text': 'here we have this p and address of this p is, suppose, 204, right, any address you can take in the memory.', 'start': 213.639, 'duration': 8.453}, {'end': 224.214, 'text': 'so what is the value of this p?', 'start': 222.092, 'duration': 2.122}, {'end': 229.537, 'text': 'this value of this p is always address of another variable.', 'start': 224.214, 'duration': 5.323}, {'end': 234.34, 'text': 'so here you can write something like this p is equal to address of b.', 'start': 229.537, 'duration': 4.803}, {'end': 236.502, 'text': 'you can initialize a pointer, something like this.', 'start': 234.34, 'duration': 2.162}, {'end': 238.003, 'text': 'now what is the value of this p?', 'start': 236.502, 'duration': 1.501}, {'end': 239.804, 'text': 'that is, address of b.', 'start': 238.003, 'duration': 1.801}, {'end': 241.105, 'text': 'address of b is 200.', 'start': 239.804, 'duration': 1.301}, {'end': 242.006, 'text': 'so here you will write 200.', 'start': 241.105, 'duration': 0.901}, {'end': 247.89, 'text': 'fine, but you cannot write something like this p is equal to b.', 'start': 242.006, 'duration': 5.884}], 'summary': 'Explanation of pointers and memory addresses with quantifiable data and key points.', 'duration': 50.51, 'max_score': 197.38, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/4Rll-_e9-0M/pics/4Rll-_e9-0M197380.jpg'}, {'end': 375.342, 'src': 'embed', 'start': 347.005, 'weight': 0, 'content': [{'end': 354.587, 'text': 'and if you want to print the address of b, so simply in the printf you can write.', 'start': 347.005, 'duration': 7.582}, {'end': 359.128, 'text': 'if you want to print the address in hexadecimal form, then you will write %p.', 'start': 354.587, 'duration': 4.541}, {'end': 360.588, 'text': 'you can also write %x.', 'start': 359.128, 'duration': 1.46}, {'end': 369.21, 'text': 'also you can also write somewhere it is written %u fine, and so you can print address of b.', 'start': 360.588, 'duration': 8.622}, {'end': 370.73, 'text': 'it will print address of b.', 'start': 369.21, 'duration': 1.52}, {'end': 371.851, 'text': 'here i am taking address 200.', 'start': 370.73, 'duration': 1.121}, {'end': 375.342, 'text': 'so it will print 200.', 'start': 371.851, 'duration': 3.491}], 'summary': "To print the address of variable 'b' in hexadecimal form, use %p or %x in printf. address 200 will be printed.", 'duration': 28.337, 'max_score': 347.005, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/4Rll-_e9-0M/pics/4Rll-_e9-0M347005.jpg'}], 'start': 62.258, 'title': 'Pointers and arrays relationship', 'summary': 'Discusses the relationship between arrays and pointers, emphasizing that pointers store the address of another variable and the data type of the pointer is based on the type of variable it points to. it also explains the basics of pointers, including the concept of addresses, dereferencing, and printing values and addresses, with examples of how arrays are related to pointers and how they act as pointers themselves.', 'chapters': [{'end': 169.443, 'start': 62.258, 'title': 'Pointers and arrays relationship', 'summary': 'Discusses the relationship between arrays and pointers, highlighting the declaration of pointers and emphasizing that pointers store the address of another variable and the data type of the pointer is based on the type of variable it points to.', 'duration': 107.185, 'highlights': ['Pointers store the address of another variable and the data type of the pointer is based on the type of variable it points to, such as integer, float, or character.', 'Understanding the declaration of pointers involves defining the data type followed by an asterisk and then the name of the pointer.', 'The relationship between arrays and pointers is about to be discussed, where the size of an integer is 4 bytes in typical compilers and the index of an array starts from 0.']}, {'end': 438.46, 'start': 169.443, 'title': 'Understanding pointers and addresses', 'summary': 'Explains the basics of pointers, including the concept of addresses, dereferencing, and printing values and addresses, with examples of how arrays are related to pointers and how they act as pointers themselves.', 'duration': 269.017, 'highlights': ["The value of a pointer is always the address of another variable, and to initialize a pointer, we can use the syntax 'p = &b', where 'p' will then contain the address of 'b', for example, 'p = 200'.", "To print the value of a variable through pointers, we use the dereferencing operator '*' in printf, which allows us to print the value at the address that the pointer is pointing to, for example, 'printf('%d', *p)' will print the value stored at the address 'p'.", "The array name itself acts as a pointer, so simply printing the array name in printf, for example, 'printf('%p', a)', will output the base address of the array."]}], 'duration': 376.202, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/4Rll-_e9-0M/pics/4Rll-_e9-0M62258.jpg', 'highlights': ['Pointers store the address of another variable and the data type of the pointer is based on the type of variable it points to, such as integer, float, or character.', "The value of a pointer is always the address of another variable, and to initialize a pointer, we can use the syntax 'p = &b', where 'p' will then contain the address of 'b', for example, 'p = 200'.", 'Understanding the declaration of pointers involves defining the data type followed by an asterisk and then the name of the pointer.', "To print the value of a variable through pointers, we use the dereferencing operator '*' in printf, which allows us to print the value at the address that the pointer is pointing to, for example, 'printf('%d', *p)' will print the value stored at the address 'p'.", 'The relationship between arrays and pointers is about to be discussed, where the size of an integer is 4 bytes in typical compilers and the index of an array starts from 0.', "The array name itself acts as a pointer, so simply printing the array name in printf, for example, 'printf('%p', a)', will output the base address of the array."]}, {'end': 802.404, 'segs': [{'end': 536.178, 'src': 'embed', 'start': 438.46, 'weight': 1, 'content': [{'end': 447.144, 'text': 'fine. so in this case, if i am taking another pointer suppose int star and q in somewhere in memory.', 'start': 438.46, 'duration': 8.684}, {'end': 449.825, 'text': 'suppose here i am taking q.', 'start': 447.144, 'duration': 2.681}, {'end': 452.586, 'text': 'this is allocated to q at address 300.', 'start': 449.825, 'duration': 2.761}, {'end': 458.752, 'text': 'suppose, fine, and have to initialize this pointer now.', 'start': 452.586, 'duration': 6.166}, {'end': 463.013, 'text': 'in this case, can we write q is equal to a?', 'start': 458.752, 'duration': 4.261}, {'end': 463.953, 'text': 'yes, you can write.', 'start': 463.013, 'duration': 0.94}, {'end': 467.914, 'text': 'this is correct, but in this case it is not valid.', 'start': 463.953, 'duration': 3.961}, {'end': 469.554, 'text': 'now, in this case, why it is valid?', 'start': 467.914, 'duration': 1.64}, {'end': 475.315, 'text': 'because array a is array name and array name always contains the base address of array.', 'start': 469.554, 'duration': 5.761}, {'end': 482.177, 'text': 'so this 100 would be assigned to q and that is fine, because q is a pointer and that will contain address of another variable.', 'start': 475.315, 'duration': 6.862}, {'end': 486.9, 'text': 'so here in the queue, what value is to be stored, hundred.', 'start': 483.197, 'duration': 3.703}, {'end': 496.547, 'text': 'so this queue would point to here this address of that element at zeroth location.', 'start': 486.9, 'duration': 9.647}, {'end': 498.649, 'text': 'fine, see, that is also correct.', 'start': 496.547, 'duration': 2.102}, {'end': 508.471, 'text': 'if now, if you will write, queue is equal to address of a of two, now this pointer will point to a of 2.', 'start': 498.649, 'duration': 9.822}, {'end': 510.772, 'text': 'a of 2 means this one address is 108.', 'start': 508.471, 'duration': 2.301}, {'end': 514.815, 'text': 'now this pointer will points to 108.', 'start': 510.772, 'duration': 4.043}, {'end': 525.042, 'text': 'so now in this case, see, if you will print percentage p and a a, then it will print 100.', 'start': 514.815, 'duration': 10.227}, {'end': 534.497, 'text': 'fine. and if you print percentage p, this q, it will also print 100.', 'start': 525.042, 'duration': 9.455}, {'end': 536.178, 'text': 'q is also 100.', 'start': 534.497, 'duration': 1.681}], 'summary': 'Explanation of pointer assignment and initialization using specific memory addresses and array elements.', 'duration': 97.718, 'max_score': 438.46, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/4Rll-_e9-0M/pics/4Rll-_e9-0M438460.jpg'}, {'end': 585.569, 'src': 'embed', 'start': 556.806, 'weight': 5, 'content': [{'end': 564.779, 'text': 'in this case, if i write now, q plus plus, that is valid, is a pointer.', 'start': 556.806, 'duration': 7.973}, {'end': 567.863, 'text': 'now the value of q is what say here.', 'start': 564.779, 'duration': 3.084}, {'end': 569.485, 'text': 'we are taking this q fine.', 'start': 567.863, 'duration': 1.622}, {'end': 577.456, 'text': 'so value of q is 100, but if you say it will becomes 101, that is not true.', 'start': 569.485, 'duration': 7.971}, {'end': 580.166, 'text': 'so now q plus plus is what see.', 'start': 577.456, 'duration': 2.71}, {'end': 582.287, 'text': 'now q contains address of another variable.', 'start': 580.166, 'duration': 2.121}, {'end': 585.569, 'text': 'that is integer variable.', 'start': 582.287, 'duration': 3.282}], 'summary': 'Incrementing a pointer in c results in pointing to the next memory address, not increasing the value stored at the address.', 'duration': 28.763, 'max_score': 556.806, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/4Rll-_e9-0M/pics/4Rll-_e9-0M556806.jpg'}, {'end': 645.156, 'src': 'embed', 'start': 614.42, 'weight': 0, 'content': [{'end': 617.562, 'text': 'right in float, it would be incremented by some other factor.', 'start': 614.42, 'duration': 3.142}, {'end': 625.609, 'text': 'in double, it would be incremented by some other factor and that factor is what the data type, the that size of that data type.', 'start': 617.562, 'duration': 8.047}, {'end': 632.974, 'text': 'fine, now, see, if you do q plus plus now, this q would point here, not here.', 'start': 625.609, 'duration': 7.365}, {'end': 634.956, 'text': 'now. q would point here.', 'start': 632.974, 'duration': 1.982}, {'end': 645.156, 'text': 'now, if you will print this q, if you will print after this line this q, then the output would be 104 and if you print a again,', 'start': 636.388, 'duration': 8.768}], 'summary': 'Explanation of variable incrementation in different data types.', 'duration': 30.736, 'max_score': 614.42, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/4Rll-_e9-0M/pics/4Rll-_e9-0M614420.jpg'}], 'start': 438.46, 'title': 'Pointer and array operations in c', 'summary': "Discusses pointer operations, array elements, and size's effect on pointer arithmetic. it also covers incrementing values, accessing array elements and addresses, and differences between arrays and pointers.", 'chapters': [{'end': 634.956, 'start': 438.46, 'title': 'Pointer operations in c', 'summary': 'Discusses pointer operations in c, including initializing pointers, pointing to array elements, incrementing and decrementing pointers, and the size of data types affecting pointer arithmetic.', 'duration': 196.496, 'highlights': ['The chapter discusses how array names always contain the base address of the array, allowing pointers to point to specific array elements, such as q pointing to address 100 and 108, and printing the values stored at those addresses.', 'It explains the concept of incrementing pointers, clarifying that the increment depends on the size of the data type, such as increasing by 4 bytes for an integer pointer and by 1 for a character pointer, and how the data type affects the pointer arithmetic.', 'The chapter also highlights the limitations of pointer arithmetic, emphasizing that adding or multiplying addresses is not allowed, but incrementing and decrementing pointers by integer values is permitted.']}, {'end': 802.404, 'start': 636.388, 'title': 'Pointer and array operations', 'summary': 'Discusses pointer and array operations, highlighting that incrementing the value of a++ is not allowed, while q++ is valid; accessing the value at array of 2 is not allowed, and the difference between the address of a and a itself. arrays allow accessing elements using the array name as a pointer, while pointer values are accessed using the dereferencing operator.', 'duration': 166.016, 'highlights': ['Incrementing the value of a++ is not allowed, but q++ is valid, showcasing the difference in allowed operations for array and pointer incrementing.', 'Accessing the value at array of 2 is not allowed, as it attempts to assign the value 1 to q, which is not allowed as q is a pointer.', 'Highlighting the difference between the address of a and a itself, emphasizing that a is the base address of the array, while the address of q prints the address of the pointer q.', 'Arrays allow accessing elements using the array name as a pointer, while pointer values are accessed using the dereferencing operator, which is demonstrated through the printf function.']}], 'duration': 363.944, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/4Rll-_e9-0M/pics/4Rll-_e9-0M438460.jpg', 'highlights': ['The chapter discusses how array names contain the base address, allowing pointers to point to specific array elements.', 'Incrementing pointers depends on the size of the data type, affecting the pointer arithmetic.', 'Limitations of pointer arithmetic: adding or multiplying addresses is not allowed, but incrementing and decrementing pointers by integer values is permitted.', 'Difference in allowed operations for array and pointer incrementing: Incrementing the value of a++ is not allowed, but q++ is valid.', 'Accessing the value at array of 2 is not allowed, as it attempts to assign the value 1 to q, which is not allowed as q is a pointer.', 'Difference between the address of a and a itself, emphasizing that a is the base address of the array, while the address of q prints the address of the pointer q.', 'Arrays allow accessing elements using the array name as a pointer, while pointer values are accessed using the dereferencing operator.']}, {'end': 988.183, 'segs': [{'end': 832.589, 'src': 'embed', 'start': 802.404, 'weight': 4, 'content': [{'end': 812.155, 'text': 'if i do plus 2, it means in base address, in this address address you are adding what 2 it is.', 'start': 802.404, 'duration': 9.751}, {'end': 814.575, 'text': "it doesn't mean that 102.", 'start': 812.155, 'duration': 2.42}, {'end': 822.658, 'text': 'no, i have told you in address, if you want to add, then it will add the according to the size of that data type you are using.', 'start': 814.575, 'duration': 8.083}, {'end': 827.079, 'text': 'so one integer will take 4 bytes and 2 will take 8 bytes.', 'start': 822.658, 'duration': 4.421}, {'end': 830.16, 'text': 'so it will add 8 bytes.', 'start': 827.079, 'duration': 3.081}, {'end': 832.188, 'text': 'it means 108.', 'start': 830.16, 'duration': 2.028}, {'end': 832.589, 'text': 'it means 108.', 'start': 832.188, 'duration': 0.401}], 'summary': 'Adding 2 to base address results in 108 due to 8-byte increment for 2 integers.', 'duration': 30.185, 'max_score': 802.404, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/4Rll-_e9-0M/pics/4Rll-_e9-0M802404.jpg'}, {'end': 940.373, 'src': 'embed', 'start': 861.609, 'weight': 0, 'content': [{'end': 866.413, 'text': 'So you can simply write q plus 1 and asterisk.', 'start': 861.609, 'duration': 4.804}, {'end': 871.977, 'text': 'because q will contain q contains what 104 plus 1.', 'start': 867.352, 'duration': 4.625}, {'end': 874.78, 'text': 'if you do it means 4 bytes would be added.', 'start': 871.977, 'duration': 2.803}, {'end': 876.141, 'text': 'that is 108.', 'start': 874.78, 'duration': 1.361}, {'end': 885.194, 'text': 'and if you want to print what is there at address 108, then you will have to use dereferencing operator, so it will also give you 1.', 'start': 876.141, 'duration': 9.053}, {'end': 894.262, 'text': "if, suppose you haven't done this, q++ and q is still pointing at this base address, then you will use a strict q plus two and it will print one,", 'start': 885.194, 'duration': 9.068}, {'end': 896.364, 'text': 'the value, this one.', 'start': 894.262, 'duration': 2.102}, {'end': 901.369, 'text': 'and if you want to print value at this, you want to print a of three, then simple fundize.', 'start': 896.364, 'duration': 5.005}, {'end': 902.249, 'text': 'you can write a of three.', 'start': 901.369, 'duration': 0.88}, {'end': 907.594, 'text': 'or you can write asterisk, a plus 3, or you can write q plus 3.', 'start': 903.09, 'duration': 4.504}, {'end': 910.497, 'text': 'if q is pointing here at the base address.', 'start': 907.594, 'duration': 2.903}, {'end': 925.589, 'text': 'fine. so in another word, you can say this a of i is equal to asterisk, a plus i, or you can write asterisk if you are taking some pointers,', 'start': 910.497, 'duration': 15.092}, {'end': 934.496, 'text': 'then also you can write q plus i, because here we are taking q as a pointer, which is pointing toward that starting index of this a.', 'start': 925.589, 'duration': 8.907}, {'end': 936.758, 'text': 'so this is equal to q plus i.', 'start': 934.496, 'duration': 2.262}, {'end': 940.373, 'text': 'fine, now see this a plus i.', 'start': 936.758, 'duration': 3.615}], 'summary': 'Using pointers to access and manipulate memory addresses and values in c programming.', 'duration': 78.764, 'max_score': 861.609, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/4Rll-_e9-0M/pics/4Rll-_e9-0M861609.jpg'}], 'start': 802.404, 'title': 'Pointer arithmetic and dereferencing in c', 'summary': 'Explains pointer arithmetic and dereferencing in c, highlighting the addition of 2 to a pointer resulting in the address 108 and demonstrating the use of the dereferencing operator to access the value at the address. it also discusses the relationship between a[i], *(a+i), and *(i+a) in pointer arithmetic, emphasizing their equivalence and the potential to print the same value using different notations and pointers.', 'chapters': [{'end': 910.497, 'start': 802.404, 'title': 'Pointer arithmetic and dereferencing', 'summary': 'Explains pointer arithmetic and dereferencing, highlighting that adding 2 to a pointer to an integer results in the address 108, demonstrating the use of the dereferencing operator to access the value at the address.', 'duration': 108.093, 'highlights': ['The chapter emphasizes that adding 2 to a pointer to an integer results in the address 108 because each integer takes 4 bytes, resulting in an addition of 8 bytes (4 bytes for each integer).', 'Furthermore, it demonstrates using the dereferencing operator to access the value at the address, which prints the value 1, showcasing the practical application of pointer arithmetic and dereferencing.', 'Additionally, it explains the use of pointers to access variables and how incrementing a pointer by 1 results in a change of address, providing a deeper understanding of pointer manipulation.']}, {'end': 988.183, 'start': 910.497, 'title': 'Pointer arithmetic in c', 'summary': 'Discusses pointer arithmetic in c, explaining the relationship between a[i], *(a+i), and *(i+a), emphasizing their equivalence and the potential to print the same value using different notations and pointers.', 'duration': 77.686, 'highlights': ['The relationship between a[i], *(a+i), and *(i+a) is explained, highlighting their equivalence and interchangeability.', 'The potential to print the same value using different notations and pointers is demonstrated, emphasizing the flexibility in C programming.', 'The demonstration of using pointers to achieve the same output is provided, showcasing the versatility and interchangeability of pointer arithmetic.']}], 'duration': 185.779, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/4Rll-_e9-0M/pics/4Rll-_e9-0M802404.jpg', 'highlights': ['Adding 2 to a pointer results in address 108 due to each integer taking 4 bytes.', 'Dereferencing operator accesses value at address, printing value 1.', 'Incrementing a pointer by 1 results in a change of address, deepening pointer manipulation understanding.', 'a[i], *(a+i), and *(i+a) are equivalent and interchangeable in pointer arithmetic.', 'Different notations and pointers can print the same value, showcasing C programming flexibility.', 'Using pointers demonstrates versatility and interchangeability in achieving the same output.']}, {'end': 1176.896, 'segs': [{'end': 1014.403, 'src': 'embed', 'start': 988.183, 'weight': 0, 'content': [{'end': 996.344, 'text': 'now next thing is, if you want to print the value at this zeroth index, then what you will write percentage d, a of 0, fine.', 'start': 988.183, 'duration': 8.161}, {'end': 1000.326, 'text': 'or you can write here asterisk a.', 'start': 996.344, 'duration': 3.982}, {'end': 1004.567, 'text': 'that will also print value at this a of 0, that is 6.', 'start': 1000.326, 'duration': 4.241}, {'end': 1005.668, 'text': 'it will also print 6.', 'start': 1004.567, 'duration': 1.101}, {'end': 1009.529, 'text': 'a will give address base address of that array.', 'start': 1005.668, 'duration': 3.861}, {'end': 1009.969, 'text': 'that is 100.', 'start': 1009.529, 'duration': 0.44}, {'end': 1012.07, 'text': 'asterisk means value.', 'start': 1009.969, 'duration': 2.101}, {'end': 1014.403, 'text': 'at this address value is 6..', 'start': 1012.07, 'duration': 2.333}], 'summary': 'Printing the value at index 0 returns 6, with the base address being 100.', 'duration': 26.22, 'max_score': 988.183, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/4Rll-_e9-0M/pics/4Rll-_e9-0M988183.jpg'}, {'end': 1119.357, 'src': 'heatmap', 'start': 1065.674, 'weight': 0.826, 'content': [{'end': 1074.038, 'text': 'integer will take 4 bytes, that is 104, and if you print this one address of a plus 1, it will not give you 104.', 'start': 1065.674, 'duration': 8.364}, {'end': 1077.499, 'text': 'now what should be the output of this one address of a.', 'start': 1074.038, 'duration': 3.461}, {'end': 1089.504, 'text': 'obviously address of a and a is same address of a means 100, and if you want plus 1 in address of a, then it will increment it by the.', 'start': 1077.499, 'duration': 12.005}, {'end': 1092.325, 'text': 'you know the complete array address.', 'start': 1089.504, 'duration': 2.821}, {'end': 1095.951, 'text': 'So complete array contains five elements.', 'start': 1093.769, 'duration': 2.182}, {'end': 1101.216, 'text': 'The address for, I mean, the size of five elements would be five into four.', 'start': 1096.511, 'duration': 4.705}, {'end': 1103.117, 'text': 'That is 20.', 'start': 1101.776, 'duration': 1.341}, {'end': 1106.3, 'text': 'So it should return 120 in this case.', 'start': 1103.117, 'duration': 3.183}, {'end': 1111.413, 'text': 'It means it will point to here 120.', 'start': 1107.141, 'duration': 4.272}, {'end': 1113.054, 'text': 'So these are two different things.', 'start': 1111.413, 'duration': 1.641}, {'end': 1119.357, 'text': 'Now I want you to execute these lines and tell me is it following the same logic or not.', 'start': 1113.634, 'duration': 5.723}], 'summary': 'Integer takes 4 bytes, array address increments by 4, 5-element array size is 20, resulting in a pointer to 120.', 'duration': 53.683, 'max_score': 1065.674, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/4Rll-_e9-0M/pics/4Rll-_e9-0M1065674.jpg'}, {'end': 1176.896, 'src': 'embed', 'start': 1128.764, 'weight': 1, 'content': [{'end': 1132.746, 'text': 'that should be 104, because address of a of 0.', 'start': 1128.764, 'duration': 3.982}, {'end': 1135.148, 'text': 'specifically, you are assigning a of 0.', 'start': 1132.746, 'duration': 2.402}, {'end': 1138.77, 'text': 'a of 0 means this one address is 100 and 100 plus 1.', 'start': 1135.148, 'duration': 3.622}, {'end': 1140.872, 'text': 'that is 104.', 'start': 1138.77, 'duration': 2.102}, {'end': 1142.893, 'text': 'first element, address plus 1.', 'start': 1140.872, 'duration': 2.021}, {'end': 1144.474, 'text': 'that is this one only.', 'start': 1142.893, 'duration': 1.581}, {'end': 1148.837, 'text': 'but if you write simply address of a plus 1, that could add on 120.', 'start': 1144.474, 'duration': 4.363}, {'end': 1160.245, 'text': 'now, if in printf, if i write asterisk a %d, asterisk a, then it will print what value at this one it means 6, it will print 6 right.', 'start': 1148.837, 'duration': 11.408}, {'end': 1174.054, 'text': 'and if you write asterisk a plus 1 and another thing is asterisk a plus 1, these two outputs, see here.', 'start': 1160.245, 'duration': 13.809}, {'end': 1175.835, 'text': 'i have used brackets here.', 'start': 1174.054, 'duration': 1.781}, {'end': 1176.896, 'text': 'i am not using brackets.', 'start': 1175.835, 'duration': 1.061}], 'summary': 'Addresses and values manipulation, pointers, and output differences in c programming explained.', 'duration': 48.132, 'max_score': 1128.764, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/4Rll-_e9-0M/pics/4Rll-_e9-0M1128764.jpg'}], 'start': 988.183, 'title': 'Pointers and array addressing in c', 'summary': 'Explains accessing and printing array values using pointers in c, including pointer arithmetic, array addressing, and memory allocation, with demonstrations of accessing specific elements and values.', 'chapters': [{'end': 1040.977, 'start': 988.183, 'title': 'Understanding pointers in c', 'summary': 'Explains how to access and print values of an array using pointers in c, demonstrating the use of pointers to access specific array elements and their values at specific memory addresses.', 'duration': 52.794, 'highlights': ["The chapter demonstrates how to print the value at index 0 of an array using '%d' and '*a', both resulting in the output of 6.", "It explains how using 'q' as a pointer also allows for printing the value at the base address of the array, which is 100, and in turn, printing the value 6.", "The chapter also discusses the output of 'a+1' and the address of 'a+1', which would result in the base address of the array (100) and the address of the next element respectively."]}, {'end': 1176.896, 'start': 1040.977, 'title': 'Pointer arithmetic and array addressing', 'summary': 'Discusses pointer arithmetic and array addressing, illustrating how adding 1 to an address in c programming can point to the next element, with a detailed explanation of memory allocation and array addressing, ending with a demonstration of printing value at a specific address and the subsequent address in an array.', 'duration': 135.919, 'highlights': ['Illustration of how adding 1 to an address in C programming can point to the next element Adding 1 to an address in C programming points to the next element, not the value 101; using base address 100 and hexadecimal form; result in printf would be 104', "Explanation of memory allocation and array addressing Address of 'a' and 'a' are the same, which is 100; incrementing address of 'a' by 1 points to 104; complete array size is 20, pointing to 120", 'Demonstration of printing value at a specific address and the subsequent address in an array Printing the value at address 100 (6) and address 104 (value after adding 1 to the address); using the asterisk symbol to print the value at a specific address']}], 'duration': 188.713, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/4Rll-_e9-0M/pics/4Rll-_e9-0M988183.jpg', 'highlights': ["The chapter demonstrates how to print the value at index 0 of an array using '%d' and '*a', both resulting in the output of 6.", 'Illustration of how adding 1 to an address in C programming can point to the next element Adding 1 to an address in C programming points to the next element, not the value 101; using base address 100 and hexadecimal form; result in printf would be 104', "It explains how using 'q' as a pointer also allows for printing the value at the base address of the array, which is 100, and in turn, printing the value 6.", "Explanation of memory allocation and array addressing Address of 'a' and 'a' are the same, which is 100; incrementing address of 'a' by 1 points to 104; complete array size is 20, pointing to 120", "The chapter also discusses the output of 'a+1' and the address of 'a+1', which would result in the base address of the array (100) and the address of the next element respectively.", 'Demonstration of printing value at a specific address and the subsequent address in an array Printing the value at address 100 (6) and address 104 (value after adding 1 to the address); using the asterisk symbol to print the value at a specific address']}, {'end': 1504.65, 'segs': [{'end': 1238.934, 'src': 'embed', 'start': 1198.102, 'weight': 5, 'content': [{'end': 1201.945, 'text': 'then the practice is a very good thing in case of programming.', 'start': 1198.102, 'duration': 3.843}, {'end': 1206.587, 'text': 'So I am again and again saying just do practice of these things.', 'start': 1202.765, 'duration': 3.822}, {'end': 1208.447, 'text': 'I cannot tell you everything.', 'start': 1207.027, 'duration': 1.42}, {'end': 1210.888, 'text': 'So, just try to modify these things also.', 'start': 1208.507, 'duration': 2.381}, {'end': 1215.61, 'text': 'Fine See, I have told you that I can write Q++.', 'start': 1211.769, 'duration': 3.841}, {'end': 1219.612, 'text': "So, it's up to you that you have to be a critical thinker.", 'start': 1216.571, 'duration': 3.041}, {'end': 1226.055, 'text': 'You have to try that can I write Q into 2? Can I write Q divide by 2? Something like this.', 'start': 1220.112, 'duration': 5.943}, {'end': 1233.032, 'text': 'and if you do practice a lot of practice, then you can easily grab these programming concepts.', 'start': 1227.17, 'duration': 5.862}, {'end': 1238.934, 'text': 'see, maybe you will initialize this array with some other values and you will get some value here and you will get some value here.', 'start': 1233.032, 'duration': 5.902}], 'summary': 'Practice programming concepts to become a critical thinker and easily grasp the concepts through a lot of practice.', 'duration': 40.832, 'max_score': 1198.102, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/4Rll-_e9-0M/pics/4Rll-_e9-0M1198102.jpg'}, {'end': 1339.877, 'src': 'embed', 'start': 1279.896, 'weight': 0, 'content': [{'end': 1288.363, 'text': 'i++ scanf is a function which is used to take input %d, and here I am writing address of a and i in this case.', 'start': 1279.896, 'duration': 8.467}, {'end': 1302.815, 'text': 'I am writing this case, this one, and at this place also I can write a plus i rather than writing address of a of i.', 'start': 1288.363, 'duration': 14.452}, {'end': 1311.252, 'text': 'you can also write a plus i, simply a plus i, because see a will return address 100.', 'start': 1302.815, 'duration': 8.437}, {'end': 1314.635, 'text': 'in first case i value is 0, 100 plus 0, that is 100 only.', 'start': 1311.252, 'duration': 3.383}, {'end': 1318.579, 'text': 'in second case, i plus plus i value would be 1, a plus 1.', 'start': 1314.635, 'duration': 3.944}, {'end': 1321.622, 'text': 'that means a contains 100, 100 plus 1.', 'start': 1318.579, 'duration': 3.043}, {'end': 1324.626, 'text': '100 is a point address and it will.', 'start': 1321.622, 'duration': 3.004}, {'end': 1332.193, 'text': 'if you add plus 1, it means it will contain the address of next element, that is 104, because size of integer is 4 bytes.', 'start': 1324.626, 'duration': 7.567}, {'end': 1334.854, 'text': 'so you can write this also if you want to print.', 'start': 1332.193, 'duration': 2.661}, {'end': 1339.877, 'text': 'now value suppose user has entered some value, that is 1, 2, 3 and 4, 5.', 'start': 1334.854, 'duration': 5.023}], 'summary': 'Explains the use of scanf and addresses in c programming, demonstrating how a plus i can be used instead of writing address of a plus i, and discussing the implications of i++ on the value of i. also touches upon the concept of pointer arithmetic and gives an example of user input values.', 'duration': 59.981, 'max_score': 1279.896, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/4Rll-_e9-0M/pics/4Rll-_e9-0M1279896.jpg'}, {'end': 1472.811, 'src': 'heatmap', 'start': 1444.3, 'weight': 0.799, 'content': [{'end': 1448.562, 'text': 'sorry, pointer name is q, q plus i.', 'start': 1444.3, 'duration': 4.262}, {'end': 1449.882, 'text': 'so now see one.', 'start': 1448.562, 'duration': 1.32}, {'end': 1450.663, 'text': 'one question.', 'start': 1449.882, 'duration': 0.781}, {'end': 1455.978, 'text': 'is This Q and this A contains same thing 100 and 100..', 'start': 1450.663, 'duration': 5.315}, {'end': 1459.301, 'text': 'So can I use here address of QI??', 'start': 1455.978, 'duration': 3.323}, {'end': 1464.086, 'text': 'You are going to tell me, can I use here this address of Q and I??', 'start': 1460.282, 'duration': 3.804}, {'end': 1467.627, 'text': 'so these are some questions.', 'start': 1466.126, 'duration': 1.501}, {'end': 1472.811, 'text': 'you are supposed to try these modifications when you are writing a program.', 'start': 1467.627, 'duration': 5.184}], 'summary': 'The transcript discusses using the address of q and i in a program with the values 100 and 100.', 'duration': 28.511, 'max_score': 1444.3, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/4Rll-_e9-0M/pics/4Rll-_e9-0M1444300.jpg'}], 'start': 1178.587, 'title': 'Importance of practice in programming, array initialization and pointer usage in c', 'summary': 'Emphasizes the significance of practice in programming for better understanding, critical thinking, and exploration. it also discusses array initialization, printing using pointers, address manipulation, dereferencing operators, and the relationship between pointers and arrays in c programming.', 'chapters': [{'end': 1238.934, 'start': 1178.587, 'title': 'Importance of practice in programming', 'summary': 'Emphasizes the importance of practice in programming to understand and retain concepts, and encourages critical thinking and exploration of different scenarios, ultimately leading to a better grasp of programming concepts.', 'duration': 60.347, 'highlights': ['The practice of programming is crucial for understanding and retaining concepts, with repeated practice leading to a better grasp of programming concepts.', 'Encourages critical thinking by prompting the audience to explore different scenarios and challenges, such as modifying code and experimenting with alternative operations.', 'Emphasizes the iterative process of learning programming, suggesting that continuous practice ultimately leads to a comprehensive understanding of the concepts.']}, {'end': 1363.908, 'start': 1238.934, 'title': 'Array initialization and printing using pointers', 'summary': 'Discusses initializing an array at runtime, using pointers to print the array, and explaining the concept of address manipulation and dereferencing operators in c programming.', 'duration': 124.974, 'highlights': ['Initializing an array at runtime and using pointers to print the array elements.', 'Understanding the concept of address manipulation and dereferencing operators in C programming.', "Demonstrating the use of 'scanf' function to take input and 'printf' function to print values in C programming."]}, {'end': 1504.65, 'start': 1363.908, 'title': 'Pointer and array in c', 'summary': 'Explains the concept of pointers and arrays in c, demonstrating how to access values through pointers and iterate through arrays, emphasizing the importance of practice in understanding and retaining programming concepts.', 'duration': 140.742, 'highlights': ['You can access the value of a using a strict q plus i, where q contains the base address, e.g., q plus 0 will point to the value at address 100 and q plus 1 will point to the next address, allowing you to print the values at those addresses.', 'Understanding the relationship between pointers and arrays is essential for grasping programming concepts, emphasizing the importance of practice in writing programs to reinforce understanding and retention of concepts.', 'Emphasizing the significance of practice in understanding and retaining programming concepts, as it is crucial to reinforce the understanding of pointers and arrays and any programming concept.']}], 'duration': 326.063, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/4Rll-_e9-0M/pics/4Rll-_e9-0M1178587.jpg', 'highlights': ['Emphasizes the iterative process of learning programming, suggesting that continuous practice ultimately leads to a comprehensive understanding of the concepts.', 'Encourages critical thinking by prompting the audience to explore different scenarios and challenges, such as modifying code and experimenting with alternative operations.', 'The practice of programming is crucial for understanding and retaining concepts, with repeated practice leading to a better grasp of programming concepts.', 'Understanding the relationship between pointers and arrays is essential for grasping programming concepts, emphasizing the importance of practice in writing programs to reinforce understanding and retention of concepts.', 'Emphasizing the significance of practice in understanding and retaining programming concepts, as it is crucial to reinforce the understanding of pointers and arrays and any programming concept.', 'Initializing an array at runtime and using pointers to print the array elements.', 'Understanding the concept of address manipulation and dereferencing operators in C programming.', "Demonstrating the use of 'scanf' function to take input and 'printf' function to print values in C programming.", 'You can access the value of a using a strict q plus i, where q contains the base address, e.g., q plus 0 will point to the value at address 100 and q plus 1 will point to the next address, allowing you to print the values at those addresses.']}], 'highlights': ['The chapter discusses how arrays can be declared and initialized, using an example of an array of data type int and size 5, with automatic memory allocation for elements.', "The chapter demonstrates how to print the value at index 0 of an array using '%d' and '*a', both resulting in the output of 6.", 'Understanding the relationship between pointers and arrays is essential for grasping programming concepts, emphasizing the importance of practice in writing programs to reinforce understanding and retention of concepts.', 'The practice of programming is crucial for understanding and retaining concepts, with repeated practice leading to a better grasp of programming concepts.', 'Incrementing pointers depends on the size of the data type, affecting the pointer arithmetic.', 'Using pointers demonstrates versatility and interchangeability in achieving the same output.', 'Adding 2 to a pointer results in address 108 due to each integer taking 4 bytes.', "Demonstrating the use of 'scanf' function to take input and 'printf' function to print values in C programming."]}