#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int static_store = 30;
const char *pcg = "String Literal";
int main(void)
{
double * ptd;
int number;
int i = 0;
printf("What is the maximum number of type double entries? %d\n", sizeof(double));
ptd = (double *) malloc(1);
if (ptd == NULL)
{
puts("Memory allocation failed. Goodbye.");
exit(EXIT_FAILURE);
}
/* ptd now points to an array of max elements */
puts("Enter the values (q to quit):");
while (scanf("%lf", &ptd[i]) == 1)
++i;
printf("Here are your %d entries:\n", number = i);
for (i = 0; i < number; i++)
printf("%7.2f ", ptd[i]);
free(ptd);
return 0;
}