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
Discussion:
33 comments Page 2 of 4.
Luso said:
1 decade ago
The pointer symbol * means value at address and it retrieves the data stored at that address whether it would be address of some other location or some other values.
Ankit Jain said:
1 decade ago
Simply * is called value at the address operator.
Lavanya said:
1 decade ago
int a=20,b=30,*p,*q;
p=&a;
q=&b;
p=q;
printf("%d%d",*p,*q);
Output is 30, 30
p=&a;
q=&b;
p=q;
printf("%d%d",*p,*q);
Output is 30, 30
Sandeep Samudrala said:
1 decade ago
To represent the pointers we can use the operator "*". Which access the address of particular datatype.
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
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
Nilax said:
1 decade ago
* = Used to refer to the Address of any variable.
&* = Used to Pointed variable's Value.
&* = Used to Pointed variable's Value.
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;
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;
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.
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?
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?
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....
* and -> can be used to get the values of the pointer....
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers