answersLogoWhite

Top Answer
User Avatar
Wiki User
Answered 2010-05-22 12:27:14

The asterisk (*) operator dereferences a pointer and returns the value stored in the memory pointed to by the pointer.

001
๐Ÿ™
0
๐Ÿคจ
0
๐Ÿ˜ฎ
0
๐Ÿ˜‚
0

Your Answer

Related Questions


When a pointer variable stores a non-zero memory address, we can use the dereference operator to access the value stored at that address. This is what we mean by dereferencing and is also known as indirection because we can access a value indirectly through a pointer variable. Note that if the stored address is zero, we must not dereference the pointer as the zero address indicates that the pointer is not currently pointing at any object in particular. The zero address is a reserved address so no object can ever be allocated to it.


If the element is a pointer, then dereference the element, just as you would dereference any pointer.


The dereference operator. In C, we use the * operator for this. Note that the * symbol has several meanings in C (multiplication, pointer declaration and pointer dereferencing). The meaning is determined from the context in which it is used. int x, y; /* integer variables */ int* p; /* pointer variable (pointer to int) */ x = 42; /* assign a value to the x variable */ p = &x; /* assign the address of the x variable to the pointer variable p */ y = *p; /* assign the value pointed to by p (42) to the variable y */


A pointer variable contains the address to some memory location. "Dereferencing" the pointer means getting the value stored at that memory location.


A pointer is a variable that stores a memory address. We say the variable "points-to" that memory address. A memory address is also known as a reference. Dereferencing a memory address returns the value stored at that address. Consider the following: int i = 42; When we use i we are referencing the memory where the value 42 is stored. To obtain the actual memory address itself we use the address-of operator (&) which allows us to store that memory address in a pointer variable: int* p = &i; Since p is a variable it has an address of its own, &p. The value of p is the address of i. In order to access the value of i through p, we must dereference p with the dereference operator, *p. Thus &i returns the address of i while i itself returns the value of i, 42. &p returns the address of p, p returns the value of p, which is the address of i and *p returns the dereferenced value of p, which is 42, the value stored at address &i.


A pointer is a variable used specifically to store a memory address. We say the variable "points to" the memory address because we can dereference the pointer to access the value stored at that address. The pointer's type determines how that dereferenced value will be interpreted. Being a variable, we can change the stored address and thus change which value we point at. This makes it possible for the same variable to refer to different objects in memory, which includes other pointer variables.


Yes, C++ has pointers, which are references to memory locations. which are variables that store memory addresses, or NULL (zero). If the pointer is non-NULL, the pointer is said to dereference the object (or variable) residing at the stored memory address, which permits indirect access to that object so long as the object remains in scope.


We use pointers to refer to objects in memory. Unlike a named object which can only refer to itself, a pointer can refer to any object in memory. A pointer is a variable. Just as an integer variable is used to store an integer value, a pointer is used to store a memory address. The primary operator of a pointer is the dereference operator (prefix *). This operator gives us indirect access to the value stored at that memory address. Since pointers exist in memory, they have an address (an identity), thus pointers can be used to refer to other pointers. This adds an extra level of indirection. In C, all arguments are passed to functions by value, but when the formal argument of a function is a pointer we can pass the address of an object by value instead. This is effectively the same as passing by reference. If we wish to pass a pointer by reference, we simply add an extra level of indirection to the formal argument. In so doing, we can pass the address of the pointer itself rather than the address of the object it refers to.


Under C, the address of a variable or a function can be obtained by prefixing the name with an ampersand (&), which is called a "reference operator". The address is typically stored in a pointer variable. To access the value in a pointer variable, an asterisk (*) is used, which is called a "dereference operator". For instance: void dosomethinguseless() { int x=50; int *y; y=&x; printf("%d, %d\n", x, *y); } - First, an integer variable called "x" is declared and preloaded with the value "50". - Next, a variable called "y" is declared as an integer pointer. - After that, the address of "x" is stored into "y", so that "y" now points to the address where the value of "x" is stored. - Finally, both variables are printed to demonstrate that they, in one fashion or another, represent the value "50". See the related link below for more information on C pointers.


It depends on the context. If used in a declaration, it means that the identifier is declared a pointer to a named type. If used in an expression, it means that you wish to dereference a pointer. A pointer is used to store memory addresses. Dereferencing a pointer allows the programmer to access the value stared in the memory address. In other words, it provides indirect access to the value stored in the memory address being pointed at.int i, *p; /* declare an integer and a pointer to an integer */p = &i; /* store the address of i in p (point to i)*/*p = 42; /* store the value 42 in that address (dereference) */assert (i==42); /* assert that i now holds the value 42 */It mean the content of that identifier.


A universal pointer is a pointer variable that does not specify the type being pointed at. That is, it can be used to store any memory address regardless of the type of object actually stored at that address. It can be likened to a variable type, but you cannot dereference the memory address without providing some mechanism for determining the actual type stored at that memory address. Generally you would use a universal pointer when you don't actually care what type resides at the address, you are only interested in the address itself. But just as a typed pointer can point to 0 (or NULL), so can a universal pointer, which simply means it points at nothing at all.


When you dereference a pointer you "read" the number of bytes determined by the pointer's type. That is, a char pointer dereferences a single byte while an int pointer dereferences 4 bytes (assuming a 32-bit int) -- regardless of the type actually stored at that address. However, note that a pointer can only actually point at a single byte since it only has storage for a single memory address. How many additional bytes are dereferenced is entirely dependant on the type of the pointer. To determine how many bytes are actually allocated to an address, use the sizeof operator, passing a dereferenced pointer (the pointer must point at the start of the allocation). If the pointer points at several elements of the same type (an array), then divide the total bytes by the size of the pointer's type to determine the number of elements in the array.


these are the memory locations i.e. addresses. try printing the content of pointer u'll get the memory location where they are stored. :-)


NULL Macro is simply what is defined as 0 in a macro provided by the libraryNull pointer is a pointer which has 0 or NULL value stored and points to nowhwere still it points to 0x00 i.e. the first memory location of the OSNull pointer != Uninitialized pointer because an uninitialised pointer can point anywhere in the memory location ...but a NULL pointer surely points to no where(but still behind the scene we can say that it only points to 0x00). Never we can retrive a Null pointer location using th"&" operator..neither will malloc/calloc return NULL IF THERE IS SPACE IN THE MEMORY. NULL pointer is unique !!nishantnitb@aol.com


In C language a pointer is a variable that stores the address of another variable. In other words, pointer is a variable which points or references to another one variable or a memory location. The syntax for declaring a pointer variable is as follows.type * pointer_variable_nameThe character * tells the compiler that the variable declared is a pointer. The type specified the type of data stored in the location pointed by the variable.The data stored in the location pointed by the pointer can be retrieved by a dereference operation.eg:int *a; // a is pointer of type integerint b=10; // b is an integer with value 10a = &b; // assigning a pointee - & will take the address of bprintf("%p %p %d %d",a,&b,*a,b); // Output will be in the following order(1) the address of b(2) address of b(3) value of b - through pointer dereferencing(4) value of bImportant: A pointer must be initialized or assigned before using it. By default all the pointers are bad pointers, which means the pointer is uninitialized. A dereference operation in a bad pointer may cause catastrophic impact on the system, since you might be accessing some unknown memory location.In addition (as this question is also under the Java Programming section), it should be noted that Java DOES NOT support pointers. That is, the pointer concept does not exist in Java.


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.


Pointers are not structures, non-linear or otherwise. A pointer is a variable that holds a memory address. The primary operation that may be performed upon a pointer is the dereference operator, which allows indirect access to the value stored at the memory address held by the pointer variable. Pointer arithmetic may also be applied to pointers, such that the memory address stored in the pointer may be incremented or decremented in units equal to the size of the pointer's type. Thus a pointer to int where sizeof(int) is 4 would increment or decrement in units of 4 bytes. This pointer arithmetic makes it possible for a pointer to randomly access any element in a contiguous sequence of elements (such as an array) in constant time, thus allowing both linear and non-linear access to those elements. Pointers may also be used to provide links between elements that are stored non-contiguously, thus making it possible to create complex structures such as linked lists, trees, graphs and so on. This is achieved by using a node object to contain the element along with one or more links to other nodes in the sequence, both linearly and non-linearly.


A String is treated as an object, meaning there is an object on the heap. Of course, the variable you define is a pointer to the object, and it is stored on the stack.A String is treated as an object, meaning there is an object on the heap. Of course, the variable you define is a pointer to the object, and it is stored on the stack.A String is treated as an object, meaning there is an object on the heap. Of course, the variable you define is a pointer to the object, and it is stored on the stack.A String is treated as an object, meaning there is an object on the heap. Of course, the variable you define is a pointer to the object, and it is stored on the stack.


The unary indirection operator (*) is used to dereference a pointer to a type or a function in order to convert it to an l-value or a function designator, respectively.For instance, if you declare a pointer to an int type as follows:int * i = new int(10);Then i contains the memory address (typically 32-bit or 64-bit depending on the architecture) where the integer value 10 was allocated on the heap (the free store). To dereference this pointer to determine the value stored at that memory address, or indeed to alter the value at that memory location, we use the unary indirection operator, as follows:if( *i == 10 )*i = 5;Note that the value of i has not changed -- it still contains the same memory address. But the value stored at that memory address will have been changed from 10 to 5. This can be proved by outputting both the value of i and the dereferenced value of i, both before and after changing the dereferenced value, such as:int * i = new int(10);printf( "Before:\n" );printf( "Direct value of i: 0x%.8x, indirect value of i: %d\n\n", i, *i );*i = 5;printf( "After:\n" );printf( "Direct value of i: 0x%.8x, indirect value of i: %d\n\n", i, *i );Example output:Before:Direct value of i: 0x010255f3, indirect value of i: 10After:Direct value of i: 0x010255f3, indirect value of i: 5


A pointer is a variable that stores a memory address and that allows indirect access to the object or value stored at that address.


Pointers can be stored in static memory, on the stack or on the heap, the choice is yours.


Far Pointer is a pointer that is stored using four bytes (32 bits). The bytes are stored little endian or low to high order. A far pointer can access objects up to 16K in size in any memory area. Objects larger than 16K must be accessed using huge pointers This book is basic for c , download and Read this... must required !


A Null pointer has the value 0. void pointer is a generic pointer introduced by ANSI. Before ANSI, char pointers are used as generic pointer. Generic pointer can hold the address of any data type. Pointers point to a memory address, and data can be stored at that address.


As the name suggests Pointer is used to point towards something ,here in this case it points to another variable and stored at a memory location. Pointer is a variable that stores address of another variable. Different Types of pointers are: 1)Dangling Pointers 2)NULL Pointers 3)This Pointer 4)Generic Pointer 5)Near Pointer 6)Far Pointer


--> Array is a collection of same kind of data.--> Pointer is a memory location where the data stored in the memory



Copyright ยฉ 2020 Multiply Media, LLC. All Rights Reserved. The material on this site can not be reproduced, distributed, transmitted, cached or otherwise used, except with prior written permission of Multiply.