by Dinesh Thakur Category: C Programming (Pratical)

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.

  1. Declare the variables.
  2. Using conversion method.
  3. 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;
            }
 Convert a Value to Pointer Check Address of Variable


About Dinesh Thakur

Dinesh ThakurDinesh Thakur holds an B.SC (Computer Science), MCSE, MCDBA, CCNA, CCNP, A+, SCJP certifications. Dinesh authors the hugely popular blog. Where he writes how-to guides around Computer fundamental , computer software, Computer programming, and web apps. For any type of query or something that you think is missing, please feel free to Contact us.