Top Answer
User Avatar
Wiki User
Answered 2013-08-13 16:32:10

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


Your Answer

Related Questions

An address in C or C++ is the location in memory of an object or function. An address is the contents of a pointer, as opposed to the contents of the memory location pointed to by the pointer.

int *x,*y; int a=14,b=10; x=&a; y=&b; printf(the variable and address of the variable a is %d", a,*x);

The address of an element values Address as well as value

A pointer which keeps address of a function is known as function pointer. example: { void *(*ptr)(); ptr= &display; (*ptr)(); return(0); } void display() { .................. )

A pointer is initialized by assigning the address of some object to it ... int a; // an integer int *pa; // a pointer pa = &a; // initialize the pointer (*pa); // use the pointer ... by allocating memoryand assigning that address to it ... int *pa; // a pointer to an integer pa = malloc (1 * sizeof(int)); // allocate if (pa == NULL) {... exception processing ...} (*pa); // use the pointer ... or by doing address computation with it ... int a[10]; // an array of integers int *pa; // a pointer to an integer pa = &(a+3); // initialize to the fourth element (*pa); // use the fourth element

The utility of a header node in a linked list is to simplify the functions of adding and deleting elements in the list. If you have a pointer in memory that points to the first element, then you need to pass the address of that pointer, rather than the value of that pointer, to the routines for list manipulation, because that pointer would need to change if an element were added or deleted at the head of the list. If that pointer, however, points to a special element in the list which is actually the pointer to the head of the list, then you do not need to pass the address of the pointer - you can pass its value, and it will never change. This technique "wastes" the data portion of that first element.

A pointer only holds an address information (location) in the memory. if a pointer holds points another pointer then it is a pointer to an other pointer. Pointer holds an address in the memory so in that address there is an other location information that shows another location.

Every element of a pointer array is a pointer, therefore to access the memory being pointed at by an element, dereference the element. For example: #include<iostream> int main (void) { int* a[10] = {nullptr}; for (int i=0; i<10; ++i) { a[i] = new int (i+1); } std::cout << "Address of array:\n"; std::cout << "a = 0x" << &a << std::endl; std::cout << "Address of each element in the array:\n"; for (int i=0; i<10; ++i) { std::cout << "a[" << i << "] = 0x" << &a[i] << std::endl; } std::cout << "Value of each element in the array:\n"; for (int i=0; i<10; ++i) { std::cout << "a[" << i << "] = 0x" << a[i] << std::endl; } std::cout << "Dereferenced value of each element in the array:\n"; for (int i=0; i<10; ++i) { std::cout << "a[" << i << "] = " << *a[i] << std::endl; } for (int i=0; i<10; ++i) { delete a[i]; } }

Array name is a static pointer to the array.Meaning of static here is that we can not modify the pointer (array name) value to any other value. Array name is the base address of the array in memory. for example if we have array a[5] of float starting at address 1000 in memory then a tells us the base address of array or address of a[0] i.e. 1000. a+1 tells the address of element a[1] and so on. we can access the element of an array by considering the array name as pointer. *(a+2) will access the third element of an array a i.e. a[3]. but we can't achieve it by applying ++ operator 3 times since the array pointer can't be modified.

It is because array name implies its address and if you want to access first element of it pointer address logic is as below: Arrays first element address = array base address + 0 Arrays second element address = array base address + 1

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;

pointer is the variable that holds the address of another variable

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;

Usually each member has a pointer storing the address of the next element.

Pointer which stores address of structure is called pointer to structure. Explanation : 1)sptr is pointer to structure address. 2) -> and (*) both represents the same.

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.

Pointer is an address (or a variable holding an address). Scale factor is something completely unrelated.

top pointer of a stack is the pointer that refers to the top most element of the stack.

a pointer is a variable .it specify the address of the particular variable ,the & symbol is to specify the address of the variable.

Pointer is simply a variable that stores the memory address of another variable. Pointer to pointer means double pointer ,pointer that points to another pointer variable.

Void pointer can hold the address of any kind of pointer. But we can't operate on void pointer

A pointer variable holds the address of a location in memory. But if the pointer hasn't been given a valid address, you can't dereference it. or A pointer that does not point to any data object.

Dereferencing a pointer returns the value stored at the memory address held by the pointer. This is also known as indirection. Example usage: int i = 42; // an integer int * p = &i; // a pointer to the integer std::cout<<"Address of i: 0x"<<&i<<std::endl; std::cout<<"Value of i: "<<i<<std::endl; std::cout<<"Address of p: 0x"<<&p<<std::endl; std::cout<<"Value of p: 0x"<<p<<std::endl; std::cout<<"Dereferenced value of p: "<<*p<<std::endl; Note that only pointer variables can be dereferenced. Normal variables like i cannot be dereferenced because they are not pointers.

A pointer is an object that contains the address of another object. A deference'ed pointer is an object. It was a pointer, but its address was used to locate and use that other object as if it was the original target of the instruction.

A Pointer is a Variable that holds a memory address, usually the location of another variable in memory. A pointer to pointer is known as double pointer.

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.