answersLogoWhite

0

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

User Avatar

Wiki User

9y ago

What else can I help you with?

Related Questions

When do we use an address operator in c'?

In C we use & operator while giving address of some variable to some pointer variable. & operator is also used in scanf().


C program to find address of variable?

// Use the & operator (Sometimes called the "address of" operator int variable = 7; printf("Address of variable = %d\n", &variable); printf("Value of variable = %d\n", variable);


In pointers what is the use of pointer variable?

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.


How do you check address of char variable?

Use the address-of operator: char c=32; // space character std::cout<<&c<<std::endl;


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


Which operator is used 2 access ahidden global variables?

To access a hidden global variable, use the scope resolution operator ::


It is required to use an address operator when you accept an input for a string?

No.


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 allow to access hidden global variable in c plus plus?

A hidden global variable must be one that has its scope blocked by a local variable of the same name. To access the hidden variable, use the scope resolution operator ::, such as is ::variable_name. If there is another reason for the hidden status, please clarify and restate the question.


What is the use of 'size of' in c programming?

The sizeof operator is used to determine the length of its operand (in bytes). The operand must be a type or an object of a type (a variable). The operator is a constant expression and therefore executes at compile time. As such there is no runtime overhead in repeated use of the sizeof operator.


I have an address in Gothenburg Sweden how do I find out who lives at this address?

If you know their Christian and Surname then phone the long distance operator and ask for 'information.' When you explain the situation most operators will give you the address.