answersLogoWhite

Top Answer
User Avatar
Wiki User
Answered
2014-01-28 15:59:02
2014-01-28 15:59:02

The former is variable, the latter is constant.

001
๐Ÿฆƒ
0
๐Ÿคจ
0
๐Ÿ˜ฎ
0
๐Ÿ˜‚
0

Related Questions


1. pointer to a constant means you can not change what the pointer points to 2. constant pointer means you can not change the pointer.


There are four ways to declare a pointer: <type> * <name>; - a variable pointer to a variable type. const <type> * <name>; - a variable pointer to a constant type. <type> * const <name> {address}; - a constant pointer to a variable type. const <type> * const <name> {address}; - a constant pointer to a constant type. The last two declarations are constant pointers. Being constants, you must assign an address to them at the point of instantiation. Note that the 2nd declaration is a pointer to a constant, not a constant pointer. That is, the object being referred to is treated as if it were constant but the pointer itself is variable so we can still change the address, but not the value at that address.


A pointer is a variable. A structure is a type.


Pointer to constant *ptr=10 statement is invalid in pointer to constant i.e assigning value is illegal ptr++ statement is valid in pointer to constant. pointer can be incremented and decremented, Pointer is pointing to constant data object. Declaration: const int *ptr; Constant pointers: *ptr= 10 is absolutely valid in constant pointers i.e assigning value is perfectly legal ptr+++ statement is invalid in constant pointers. pointer can not be incremented or decremented. Declaration; int *const ptr;


Pointer-variables are variables, so there is no difference.


pointer is use to hold address of another variable whereas array is a collection of elements of similar datatype


difference between pointer or structure


A pointer type differs from all other types in that it is used specifically for the purpose of storing a memory address and for permitting indirect access to the value stored at that memory address. When we store a memory address, we are said to be pointing at that memory address. When we indirectly access the value stored at that memory address, we are said to be dereferencing the pointer. We can also say that a pointer holds a reference to the object stored at the memory address it points to. Pointers may only store memory addresses where the memory holds a value of the same type as the pointer, or is of a type that is co-variant with the pointer's type. Where the type is unknown we can use a void pointer, however this is best avoided wherever possible. A pointer may be constant or variable. When it is variable, we can assign any appropriate memory address to the pointer at any time. When it is constant, we must assign an address at the point of instantiation and cannot change that address while the pointer is in scope; it must always point at the same memory. Note that the constness of the pointer does not affect the constness of the object being pointed at. However, if the object being pointed at is of a constant type, then the pointer must be a pointer to that constant type, regardless of whether the pointer itself is variable or constant. Thus we can point at a memory address in four different ways: a variable pointer to a variable type; a variable pointer to a constant type; a constant pointer to a variable type and; a constant pointer to a constant type. We define both aspects when we instantiate the pointer.


Array is a data type which can be represented as a[1],a[2],a[3].... Pointer is also a data type. The speciality of pointer is instead of address of the variable it will give the reference to the address of the variable. E.g. int *test Here test is a pointer variable. which will be the reference to the address == One dimensional arrays are constant pointers, you cannot change their values, eg: int a[10], *pa = &a[3]; p[0]= a[0]; // ok a[0]= p[0]; // ok p= a; // ok a= p; // INVALID for a is constant


normal variable stores a value of the given datatype where as the pointer variable stores the address of a variable. for example int n=10; int *p; p=&n; here p is a pointer variable and n is a normal variable.p stores the address of n where as n stores an integer value. *p prints the value of n,p prints the address of n.


once we initialize the array variable, the pointer points base address only & it's fixed and constant pointer


The stack is a memory structure where your programs can store data. The stack pointer is the variable that "points" to the current location of the top of the stack.


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.


pointer is the variable that holds the address of another variable


A null pointer is a pointer variable with the value 0. A null macro is a macro that defines the NULL symbol (typically 0L on a 32-bit system).


Well, the pointer is a type of variables that stores an address in the Memory.the reference is the address itself of a variable.


Pointer is a variable, A variable that stores the address of another variable. Size of a pointer is 2 bytes.


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.


When a variable is passed by value, the function receives a copy of the variable. When a variable is passed by reference, the function receives a reference, or pointer, to the original data.


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 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.



A node is a variable or object that has identity; it has a memory address. A link is a variable or object that stores an identity and that allows indirect access to that identity. A link may be implemented as a raw pointer or (preferably) as a resource handle (a smart pointer).


Whenever memory that was in use, and was referred to by a pointer variable, is freed, and the pointer variable is not updated accordingly (setting it to NULL, for example), the pointer variable is considerred to be a dangling pointer reference.


A pointer is a variable which is used to store address of a variable. They are used to point to another variable.eg:-int *p; // creates a pointer of integer typeint num; // an integer variablep=# //pointer variable p is assigned with address of num



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.