Pointers in C Programming
Get Certified in C Programming and Take Your Skills to the Next Level
Program 1
// Pointers in C
#include<stdio.h>
#include<conio.h>
int main()
{
system("cls");
int *a1;
float *a2;
double *a3;
char *a4;
printf("\n int type: %d",sizeof(*a1));
printf("\n float type: %d",sizeof(*a2));
printf("\n double type: %d",sizeof(*a3));
printf("\n char type: %d",sizeof(*a4));
// int a=10,b=5,*p,*r;
// p=&a;
// r=&b;
// ++*p;
// a=a+3;
// --*r;
// b=b+5;
// r=&a;
// ++a;
// ++*p;
// ++*r;
// printf("\n a=%d",a);
// printf("\n *p=%d",*p);
// printf("\n *r=%d",*r);
// printf("\n b=%d",b);
// int a=10,*p,**r;
// p=&a;
// r=&p;
// printf("value of a %d: ",a);
// printf("\nvalue of p %u: ",p);
// printf("\nvalue of *p %d: ",*p);
// printf("\nvalue of r %u: ",r);
// printf("\nvalue of *r %u: ",*r);
// printf("\nvalue of **r %d: ",**r);
// ++**r;
// printf("\n------------------------");
// printf("\nvalue of a %d: ",a);
// printf("\nvalue of *p %d: ",*p);
// printf("\nvalue of **r %d: ",**r);
return 0;
}
// int a=50,*p;
// p=&a;
// ++p;
// printf("Value is %d: ",a);
// printf("\nValue is %d: ",*p);
//printf("\n Address is %u: ",p);
// printf("Value is %d: ",a);
// printf("\n Address is %u: ",&a);
If you are Happy with DataFlair, do not forget to make us happy with your positive feedback on Google

