C 14
Address Guest on 5th April 2021 12:49:00 AM
  1. #include<stdio.h>
  2.  
  3. int a = 1;
  4. int b = 2;
  5.  
  6. int main()
  7. {
  8.   static c = 3;
  9.  
  10.   int x = 10;
  11.   double y = 1.1;
  12.   int*p = &x;
  13.   double *py = &y;
  14.  
  15.  
  16.   printf("Value of a is %d, address is %lu\n", a, (unsigned long int) &a);
  17.   printf("Value of b is %d, address is %lu\n", b, (unsigned long int) &b);
  18.   printf("Value of b is %d, address is %lu\n", c, (unsigned long int) &c);
  19.  
  20.   printf("Value of x is %d, address is %lu\n", x, (unsigned long int) &x);
  21.   printf("Value of y is %f, address is %lu\n", y, (unsigned long int) &y);
  22.  
  23.   printf("Value in pointer variable p, %lu, sizeof p: %d, address of p:  %lu \n", (unsigned long int) p,  sizeof(p), (unsigned long int) &p);
  24.   printf("Value in pointer vaiable py, %lu, sizeof py: %d\n", (unsigned long int) py, sizeof(py));
  25.  
  26.  
  27.   return 0;
  28.  
  29. }

Paste-bin is for source code and general debugging text.

Login or Register to edit, delete and keep track of your pastes and more.

Raw Paste

Login or Register to edit or fork this paste. It's free.