answersLogoWhite

0


Best Answer

// Use the & operator (Sometimes called the "address of" operator

int variable = 7;

printf("Address of variable = %d\n", &variable);

printf("Value of variable = %d\n", variable);

User Avatar

Wiki User

14y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

14y ago

main()

{

int *p, **q, a;

a = 10;

p = &a;

q = &p;

printf("/n/n value of pointer p is %d",*q);

printf("/n/n address of ponter p is %d"q);

getch();

}

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: C program to find address of variable?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is meant by an pointer in c program?

Pointer is like variable address the members in memory shell


What is the base address of an array in c program?

the address of variable (pointer) that contains array


How do pointer work in c program?

Pointer can be defined as variable that is used to store memory address , usually the location another variable in memory. Pointers provide a means through which memory location of a variable can be directly accessed.


What is pointers in c?

a pointer is a variable .it specify the address of the particular variable ,the & symbol is to specify the address of the variable.


When do we use an address operator in c'?

In C we use & operator while giving address of some variable to some pointer variable. & operator is also used in scanf().


Define pointer in C?

Pointer is a variable, A variable that stores the address of another variable. Size of a pointer is 2 bytes.


What is the variable in c language program?

A variable is the name for a place in the computer's memory where you store some data.


Is it necessary to initialize the const variable in c?

A constant variable cannot have its value changed at program run time.


What is a C variable?

A variable is an entity that may change its value. In a program, the result of the processing statements are stored in the computer's memory.


What always contains a pointer variable?

pointer variable in c contains the address or the location of the other variable. eg- if a=2 and address of a is 2345. b=&a then b is a pointer which contains 2345 which is the address of a. *b gives value of that is 2.


Static variable in c?

A static variable in C is one in which the memory is preallocated before the execution unit begins and lasts for the entire program unit.A non-static variable in C will be allocated in the block in which it is contained, and destroyed outside that block.


How do you check address of char variable?

Use the address-of operator: char c=32; // space character std::cout<<&c<<std::endl;