In this program user ask to convert a value to pointer check address of variable. User declares some variables for this to contain the value in it. User declare <math.h> header file for math functions like pi etc. the type of variable is differ like some are double, integer, char type etc. user print out the method for conversing in pointer type to using all the method for conversion display the result as output.
Problem Statement:
This is C program to convert the value into pointer.
- Declare the variables.
- Using conversion method.
- Display result on the screen.
Here is C source code to convert the value into pointer. The output of this program shown below.
#include <stdio.h>
#include <math.h>
int main ()
{
char *pc = 0;
int *pi = 0;
double *pd = 0;
printf("%8d%8d%8d\n",*pc,*pi,*pd);
printf("%8d%8d%8d\n", pc+1, pi+1, pd+1);
printf("%8d%8d%8d\n", pc+3, pi+5, pd+7);
return 0;
}