Lecture 27: Pointers In C/C++ in Punjabi Language
Computer Gyan
Pointer is used to save the address of other variable. The pointer is used for indirect reference of a variable. It holds address of the variable, where it has been stored in memory. For pointer *operator is used. That’s why it is also called as indirection operator. Its advantage is that it allows the user to access memory locations A pointer to an array contains the address of the first element. In a one-dimensional array, the first element is &[0]. In two-dimensional array, it is &value[0][0]. The address of the zeroth row and the zeroth column of the two- dimensional array value is assigned to the pointer variable value.
For example: int a[ ] [ ]; int *ptr; ptr=&a[0][0]; // or ptr= a; Array of pointers: The pointer may also declared like any other data type. The declaration of an integer pointer array of size 10 is int *ptr[10]; Where ptr is an array of pointers. It can hold the addresses of 10 integers.
Music information: I Am a Man Who Will Fight for Your Honor by Chris Zabriskie is licensed under a Creative Commons Attribution license (https://creativecommons.org/licenses/by/4.0/) Source: http://chriszabriskie.com/honor/ Artist: http://chriszabriskie.com/ ... https://www.youtube.com/watch?v=IsWzWQnVX2Q
51717404 Bytes