answersLogoWhite

Top Answer
User Avatar
Wiki User
Answered
2016-04-24 18:51:47
2016-04-24 18:51:47

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.

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

Related Questions


Void Pointer is a General purpose pointer ,that does not have any data type associated with it and can store address of any type of variable. Declaration: void * pointer_name;


In C General purpose pointer is called as a void pointer. It doesn't have any data type associated with it. It can store address of any type of 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


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.


the purpose of pointer in c for saving the memory space.,and reduce the length and complexity of the program


For the purpose of clarification, you cannot initialise types, you can only initialise variables (or constants) of a type. A variable (or constant) is known as an "instance" or "object" of the type. All instances of a type must be named. A pointer variable allows us to "refer" to a named object of the pointer's type. this is achieved by storing the memory address (the starting address) of that object. By changing the address stored in the pointer variable, the same pointer variable can be used to refer to different objects in memory. This is useful when passing objects to functions because if we pass objects directly (by name), the function receives a copy of the object. This is known as "pass by value". However, when a function expects a pointer variable rather than a named variable, the address of the object is copied instead. This is known as "pass by reference" and allows the function to operate (indirectly) upon the object being referenced rather than a copy of the object (any changes to a copy are not reflected in the original object). Passing by reference is particularly useful when the object is large and complex. To improve efficiency, we must avoid making any unnecessary copies of large or complex objects. Functions that do not modify an object are a prime example; there is no point in copying an object that will not be modified. If we wish a function to modify the object, we must pass the object by reference. The only time we should copy an object is when we're not interested in the modifications made by a function, or when we want to compare the changes that were made. In these cases we simply make a copy of the object before passing that copy to the function by reference. When working with concurrency, however, it is best to use pass by value semantics. In this way, each thread works with a local copy of your object, and thus avoids "race conditions", where one task is accessing an object that is being modified by another task, which can lead to unpredictable results. Pointer variables are said to "point at" the memory the refer to (hence they are called pointers). To access the value being pointed at, the pointer variable must be dereferenced. However, in the case of pointer to struct variables, the dereferencing is transparent. All variables in Go are implicitly initialised with the default "zero" value for its type. The zero value of a pointer variable is always "nil" (regardless of which type of pointer). You must never dereference a pointer variable that holds the nil value so always check the pointer is non-nil. Equally, you must never dereference a pointer to an object that no longer exists in memory. Always nil your pointers as soon as you are finished with them. The following example demonstrates how to initialise a pointer variable to a struct: package main import "fmt" type Point struct { X int Y int } func main () { v := Point{1, 2} // instantiate an object of type Point p := &v // assign the address of v to pointer p (p's type is inferred from v) fmt.Println(*p) // print the indirect value of v (dereference p) }


A variable you change on purpose.


the independent variable is the variable that you change on purpose(cause)


The dependent variable ( responding variable ) is the variable that changes on purpose.


independent variable- what changed on purpose



The 'this' pointer is not an operator, it is a special pointer that exists within every instance of a class, and always points to the current instance of that class. It can only be used in non-static methods of the class because static methods do not have a 'this' pointer; static methods can be called even when there is no instance of the class. Whenever an instance method refers to one of its own members (non-static members), the 'this' pointer is implied: int CMyObject::foo() { return( this->bar ); // returns the bar member of this instance. } The 'this' pointer also makes it possible for an instance to compare itself to other instance references (often to ensure they are different instances) as well as to return a reference to itself. The assignment operator cannot be implemented any other way: CMyObject& CMyObject::operator= (const CMyObject & rhs ) { if( this != &rhs ) // check for self-reference bar = rhs.bar; // perform assignment return( *this ); // return a reference to this instance. } The 'this' pointer also allows an instance to pass a reference or pointer to itself to external functions, including the methods of other instances of the same class.


A manipulated variable is the variable you're changing on purpose.


The Independent Variable, the variable that we change on purpose, that we already know before we experiment.


No, java does not support explicit operator overloading. You can use an operator only for its intended purpose. But the "+" operator is implicitly overloaded. It can be used to add two numbers as well as concatenate two strings. Apart from this operator all other operators can be used only for their specific purpose.


A manipulated variable is not changed on purpose.


The independent variable is the item YOU change on purpose from one measurement to a next. The dependent variable is what you measure after you change the independent variable.


Every instance of a class inherits a 'this' pointer. It always points to the instance itself. Outside of the object you must use the object's variable name to refer to the object, or instantiate a pointer to the object. But from within the object's member methods you must use the 'this' pointer which is instantiated automatically as soon as the object is constructed and falls from scope when the destructor returns. Only non-static member functions have access to the 'this' pointer. There are several uses, however the most important is when checking for self-references, particularly in the assignment operator overload. That is, any member function that accepts a reference to the same class of object should always check for self-references before attempting to mutate the instance. This is particularly important when the class "owns" memory that is dynamically allocated to it. It is also used to return a reference to the current instance from the assignment operator and from any other operator overload or function that must return a reference to the current instance (including the addition and subtraction operators). Both uses can be seen in the following stripped-down example: class MyObject { public: // Assignment operator overload.MyObject& operator= ( const MyObject & obj ){ // Self-reference check. if( this != &obj ){// Assignment code goes here... } // Return a reference to this object. return( *this ); } }; The 'this' pointer can also be used to pass a pointer (this) or reference (*this) to external functions that accept such arguments. It should also be noted that when referring to an instance member from within a non-static member function, the dereferenced 'this' pointer is implied, as in: this->[member_name] Although this usage is never required, there may be times when it can help make your code more readable, or less ambiguous, especially when a member function must handle one or more external instances of the same class.


The mouse pointer is used to navigate on a computer. It allows you to place the pointer over the place you want to be on the page and then to click the mouse in order to go to another page, type in something in the address bar, etc.



Like all other mice, the purpose of a serial mouse is to move a cursor or pointer across a computer display.


The this pointer is used to refer to the object that is foremost in the current scope. It has three primary purposes. First, a programmer uses this to refer to a member variable that has been shadowed by a function argument. Secondly, it is used to obtain a reference to itself, usually for the purpose of passing itself to another function or class. Finally, the this pointer can be used to call alternate constructors of the same object, usually as a means of reusing code and providing various constructors with default arguments.


The question makes no sense, but I think what you are talking about is the independent variable. The independent variable is the one thing in an experiment that is purposely changed.


The independent variable is also called an experimental variable. It is the variable being manipulated in the experiment in order to show the effect on the dependent variable. The dependent variable is also called the response variable. It is the variable being observed in the experiment. A change in the independent variable is what causes the change (if any) in the dependent variable, which is the purpose of the experiment.


The independent variable is the variable being manipulated in the experiment in order to show the effect on the dependent variable. It is also called the experimental variable.The dependent variable is the variable being observed in the experiment. Changes in the dependent variable as a result of changes in the independent variable are observed, which is the purpose of the experiment. Dependent variable is also called the response variable.



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.