#include #include int main () { double *doublePtr; char *charPtr; printf ("The number of bytes needed by a double: %d\n", sizeof(double)); printf ("The number of bytes needed by a char: %d\n", sizeof(char)); // Get the space from malloc: doublePtr = (double*) malloc (sizeof(double)); charPtr = (char*) malloc (sizeof(char)); // Print the address of the memory block returned by malloc: printf ("double pointer is at location: %p\n", doublePtr); printf ("char pointer is at location: %p\n", charPtr); // Assign values and print: *doublePtr = 3.141; *charPtr = 'A'; printf ("double value = %lf char value = %c\n", *doublePtr, *charPtr); // Free the memory when done: free (doublePtr); free (charPtr); }