yes
Assigning an initial value to a pointer variable. Example: int *p= NULL;
pointer variable in c contains the address or the location of the other variable. eg- if a=2 and address of a is 2345. b=&a then b is a pointer which contains 2345 which is the address of a. *b gives value of that is 2.
pointer
Pointer to Pointer is a double pointer, denoted by (**). Pointer stores the address of the variable and pointer to pointer stores the address of a pointer variable and syntax can be given as int **ptr2ptr;
A pointer variable is a variable that contains the memory location of another variable or an array (or anything else in memory). Effectively, it points to another memory location. For standard variables, you define a type, assign a value to that variable or read the value from it, and you can also read the memory location (&n = memory location of n) of the variable. For pointers, you can point them to any variable, even another pointer, and you can get the value of the variable it points to (*p), the location of that variable in memory (p), or the address in memory of the pointer itself (&p). Consider: long n = 65; long *p; p = &n; Results: Type | Name | Location | Value long n 0xA3FF 65 long * p 0x31DF 0xA3FF So p points to n. Now, n = 65 &n = 0xA3FF p = 0xA3FF *p = 65 &p = 0x31DF You may find yourself having to use typecasts frequently when using pointers. Pointers are useful when passing data to functions. For instance, consider the following function: void add(int a, int b, int c) { c = a + b; } The problem here is that the computer copies each variable into a new memory location before passing them to the function as local variables. This function effectively does nothing. However, if you change the function to: void add(int a, int b, int *c) { c = a + b; } and call the function by passing in the location of the variable to the function: add(a,b,&c); then you can modify the variable itself. Pointers are also good for working with arrays: char *c = "Hello World"; int i=0; while (c[i] != 0x00) { cout << c[i]; c++ } //print one letter at a time.
Pointers are meant to store adresses.
pointer is the variable that holds the address of another variable
Assigning an initial value to a pointer variable. Example: int *p= NULL;
#include<iostream> int main() { int x=42; int* p=&x; // declare and initialise a pointer, assigning the address of x. }
Pointer is a variable that stores the address of another variable . So pointer basically stores the address of another variable and size of pointer can be evaluated by using sizeof operator.
A void pointer variable is a pointer variable (of some type) that is assigned the value zero, meaning it points to address zero. Memory address zero is a reserved address, which means the pointer variable references nothing in particular.
Pointer is a variable, A variable that stores the address of another variable. Size of a pointer is 2 bytes.
A pointer is used for pointing to a variable. It contains the address of the variable to which it points
pointer variable B holds base address of B
Double (**) is used to denote the double pointer. As we know the pointer stores the address of variable, Double pointer stores the address of any pointer variable. Declaration : int **ptr2Ptr;
Pointer is a variable that stores the address of another variable. Since pointer is also akind of variable, thus pointer itself will be stored at a different memory location.
pointer variable in c contains the address or the location of the other variable. eg- if a=2 and address of a is 2345. b=&a then b is a pointer which contains 2345 which is the address of a. *b gives value of that is 2.