/* 1. & --This is used to get the address of the variable.
Example : &a will give address of a.
2. *-- it is used to get the value of the variable that the pointer is pointing to
3. Sizeof ()--This gives the size of the variable.
Example : size of (char) will give us
*/
#include <stdio.h>
int main()
{
int *ptr, q;
q = 50;
/* address of q is assigned to ptr */
ptr = &q;
/* display q's value using ptr variable */
printf("%d", *ptr);
return 0;
}
/*output
50
*/
Comments
Post a Comment