A.Because you can get value stored at any address only through *.& is used to retrieve the address value.!
Amruta said:
(Thu, Sep 23, 2010 11:29:48 AM)
It is also called as 'Indirection operator' and it is used to get the value stored at pointer add.
Govardhana Kj said:
(Mon, Oct 25, 2010 02:55:42 PM)
For example;
consider int x=10;
int *y;
y=&x;
printf("value at Y is %d\n",y);
output is 10
bescause 10 is stored at address say 100(which named as 'x') and again we are declaring 'y' as pointer variable which holds address of another variable(here y holds adress of 'x')which is dereferenced using "&" opearator.
Dilip said:
(Sat, Dec 4, 2010 05:16:30 AM)
It is a very good platform to learn more programming.
Yamuna said:
(Thu, Dec 9, 2010 08:09:06 AM)
By using * (pointer) symbol only we can found the answer.
Also pointer main work is to store the address of another variable.
Apurva Nigam said:
(Wed, Jan 5, 2011 10:56:14 AM)
@Govardhana Kj :
U r correct but output should be 100(address of x), coz u r printing y not *y . :) :)
printf("value at Y is %d\n",y);
Vinoth said:
(Fri, Mar 18, 2011 06:17:02 AM)
Correct apurva nigam.
Satheesh said:
(Wed, Jun 1, 2011 03:22:38 AM)
@Govardhanad is right.
Deepak said:
(Sat, Aug 6, 2011 03:11:18 PM)
No apurva is right. Output is 10 if we declare *y.
Mohammed Aabir said:
(Sat, Aug 13, 2011 11:42:10 PM)
What if give int *y;
y=&x;
printf("%d",&y);
Ramachandran said:
(Fri, Aug 19, 2011 12:44:02 AM)
@Aabir :
int x=20;
int *y=&x;
y=address of x
*y=data of x;
&y == y(same)
Ramprasad said:
(Sun, Sep 4, 2011 01:14:52 AM)
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:
(Sun, Oct 16, 2011 10:47:17 PM)
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:
(Wed, Dec 7, 2011 10:10:00 PM)
& 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:
(Sat, Jan 7, 2012 07:53:30 AM)
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:
(Wed, Feb 8, 2012 05:40:49 PM)
A. Yeah * is a symbol of pointer and we already know that pointer stores the address of the another variable.