Find address of variable

How to find the address of a variable which is declared as long double?

Questions by nirmaLmani   answers by nirmaLmani

Showing Answers 1 - 5 of 5 Answers

You can use the sizeof() operator to get the size of a variable declared as long double. try the following code:
#include<stdio.h>
#include<conio.h>
main()
{
    long double a;
    clrscr();
    printf("%d", sizeof(a));
    getch();
}

  Was this answer useful?  Yes

shiva

  • Sep 27th, 2011
 

To find add of a variable we use the % u in printf fun,,,

this %u is used in two ways

1) for unsigned integers
2) To display add

Code
  1. #include<stdio.h>

  2. "%d"

  Was this answer useful?  Yes

Get the address by using the unary "&" (address-of) operator. You can display it with printf() by using the "%p" conversion specifier (youll need to cast the argument to "void *"). See below:

Code
  1. #include <stdio.h>

  2. "address of f is %p

  3. "

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions