Get size and address for a double : Double « Data Type « C Tutorial






#include<stdio.h>

int main(void)
{
  double d = 4.0;
  double e = 5.0;
  double f = 6.0;

  printf("\n\nA variable of type double occupies %d bytes.", sizeof(double));
  printf("\nHere are the addresses of some variables of type double:");
  printf("\nThe address of d is: %p  The address of e is: %p", &d, &e);
  printf("\nThe address of f is: %p\n", &f);
  return 0;
}
A variable of type double occupies 8 bytes.
     Here are the addresses of some variables of type double:
     The address of d is: 9a378  The address of e is: 9a370
     The address of f is: 9a368








2.22.Double
2.22.1.Get size and address for a double
2.22.2.Use sscanf to get and then double a number from the user