Pointer (int,float,char) in C.

01  #include<stdio.h>
02
03
04 int main()
05 {
06 int i=10;
07
08 float f=3.14;
09
10 char c='A';
11
12 int *i_ptr= &i; // integer pointer
13
14 float *f_ptr= &f; // float pointer
15
16 char *c_ptr= &c; // character pointer
17
18 /*accessing variables via pointers*/
19
20 printf("Value of I : %d n",*i_ptr);
21
22 printf("Value of F : %f n",*f_ptr);
23
24 printf("Value of C : %c n",*c_ptr);
25
26 return 0;
27 }
 
 OUTPUT:

Value of I : 10
Value of F : 3.140000
Value of C : A

Related Post

Leave a Reply

Your email address will not be published. Required fields are marked *