C Programming - Pointers - Discussion

Discussion Forum : Pointers - General Questions (Q.No. 8)
The operator used to get value at address stored in a pointer variable is
Answer: Option
No answer description is available. Let's discuss.
33 comments Page 1 of 4.

VASANTHARAJ said:   6 years ago
* is a correct answer. I agree with the given option.

Rajasekar OMPARR said:   6 years ago
* is known as a de-referencing operator which de-reference the address stored in the pointer. That is fetched the value from that address which pointer is pointing to.

Antony said:   7 years ago
&&, || operator which operation performed?

Shraddha said:   8 years ago
I think & is used for address.

Ravi ku said:   9 years ago
void main()
int a=10;
int *p;
printf("value of A %d",a); //Output-10.
printf("value of A %d",*P); //Output-10.
printf("Address of A %p",a); //Output-fff2.
printf("value of p %d",p); //Output-fff2.
printf("Address of p %d",p); //Output-fff4.

Manmeet said:   9 years ago
If we want to fetch the address of a variable we use & and on the other hand if we want to fetch the value from the address we use *.

Parag said:   9 years ago

I have executing this code and thus it is perfect.

#include <stdio.h>

void main() {
// your code goes here

int x=10;

int *y;
printf("value at Y is %d\n",y);
printf("value at *Y is %d\n",*y);
printf("value at &Y is %d\n",&y);

Value at Y is -1076357592.
Value at *Y is 10.
Value at &Y is -1076357588.

So to conclude:

y gives address of x.
*y gives data of x.
&y gives the address of y. The memory which contains the address of x.

Veer pratap singh said:   1 decade ago
Basically pointer variable is called & operator.

Swapnali said:   1 decade ago
Pointer is used to store the address of the variable of same type. Ex. char *ptr can be used to store address of char ch..

We use & operator to assign the address of variable to pointer Ex. ptr=&ch;

And we use * operator to get value stored at particular address stored in pointer var. Ex. char chh=*ptr;

Harika said:   1 decade ago
Hi, & defines address in memory, * represents the value of pointer.

Post your comments here:

Your comments will be displayed after verification.