Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the result of &pointer in C?

Tags:

c

pointers

What is the result of the following line:

int* ptr;
printf("%x, %x\n", ptr, &ptr);

I know that ptr is an address in a memory, but what is &ptr?

like image 646
l245c4l Avatar asked Dec 23 '09 22:12

l245c4l


People also ask

What is result with example?

The definition of a result is how something ended or the outcome of some action. An example of result is a house that smells of fresh baked bread after baking bread. An example of result is the answer received in a math calculation.

What is this word result?

1 : something that results as a consequence, issue, or conclusion also : beneficial or tangible effect : fruit. 2 : something obtained by calculation or investigation.

What is the result of an action called?

The result of a certain action is called a consequence. The word repercussion often refers to a negative consequence. The word aftermath is usually reserved for the consequences of a major event—what happens after it.


1 Answers

&ptr would be the address for the memory location that ptr is held in. Essentially it is a pointer to a pointer.

like image 167
Gavin H Avatar answered Oct 31 '22 23:10

Gavin H