answersLogoWhite

0


Best Answer

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

User Avatar

Wiki User

13y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

13y ago

*asterix*

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Which is the unary operator used to dereference a pointer and return the value stored in it?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

What is the purpose of the dereference operator when used with a pointer variable?

Data type is mandatory in every variable-declaration.Example:int i; -- integerint *pi; -- integer-pointerint ai[10]; -- integer-arrayint *api[10]; -- array of integer-pointersint (*api)[10]; -- pointer to integer-array


Which operator is use to find address of a variable?

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 */


What is a use of dereferencing operator?

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


What is a universal pointer?

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.


How many bytes are read in pointers by pointers dereferencing?

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.

Related questions

What is the purpose of the operator '' when used with a pointer variable?

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.


What is the purpose of the dereference operator when used with a pointer variable?

Data type is mandatory in every variable-declaration.Example:int i; -- integerint *pi; -- integer-pointerint ai[10]; -- integer-arrayint *api[10]; -- array of integer-pointersint (*api)[10]; -- pointer to integer-array


Which operator is use to find address of a variable?

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 */


What is a use of dereferencing operator?

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


How are we going to use pointer in a program?

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.


What is a universal pointer?

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.


How many bytes are read in pointers by pointers dereferencing?

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.


What does star with identifier mean in c language?

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.


What is universal pointers?

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.


What is a null macro what is the difference between a null pointer and a null macro?

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


Why pointers are known as non linear data structure?

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.


Definition of pointer in C?

In C programming, a pointer is a variable that stores the memory address of another variable. Pointers allow for indirect access to the value stored at the memory location pointed to by the pointer. They are commonly used for dynamic memory allocation, as well as for passing arguments to functions by reference. Pointers are declared using the '' operator, and the value stored in a pointer can be accessed using the '' operator as well.