C Programming - Pointers - Discussion

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

Ramachandran said:   1 decade ago
@Aabir :

int x=20;
int *y=&x;
y=address of x
*y=data of x;
&y == y(same)

Ramprasad said:   1 decade ago
No. Actually

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

Sanu said:   1 decade ago
For example;
consider int x=10;
int *y;
y=&x;
printf("value at Y is %d\n",y);

output is 10
it is wrong if you r printing *y only get value 10
otherwise it returns address

NRV said:   1 decade ago
& is used to specify the address... eg &a specifies the address...

* and -> can be used to get the values of the pointer....

Rathika.b said:   1 decade ago
No error program:

float y=3,*i;
i=&y;
printf("value of y is %f",y);
printf("value of i is %f",i);
printf("value of y is %f",*i);

But we know address are only integers.
Then how it is assign floating point?

Durgesh jaiswal said:   1 decade ago
A. Yeah * is a symbol of pointer and we already know that pointer stores the address of the another variable.

Vinod said:   1 decade ago
Guys ramprasad is absolutely right. better u can understand by following example..
int x=10; //adress of x=100;
int *y; //address of y=102;
y=&x;
printf("%d",*y);//prints data of x is 10;
printf("%d",&y);//prints address of y is 102;
printf("%d",y); //prints address of x is 101;

Nilax said:   1 decade ago
* = Used to refer to the Address of any variable.
&* = Used to Pointed variable's Value.

Maggie said:   1 decade ago
int *p; // creates a pointer to integer
int a=10//variable a has value as 10 and address as 2000
p=&a//here address of a(2000) is stored in p ie p is pointing to a
int b;//a variable
b=*p;//the pointer penetrates into a to fetch the value and stores it in b;
printf("%d",b);

output:10

Sandeep Samudrala said:   1 decade ago
To represent the pointers we can use the operator "*". Which access the address of particular datatype.


Post your comments here:

Your comments will be displayed after verification.