Well, I decided that I would post a question and ask for comments. The question is
In the programming language "C", how many times can you take the address of a variable v? So if v is a variable can I use &v, &&v, &&&v, etc? What is the limit to taking addresses?
I think I know the answer and it seems straight forward. Once, I get comments, I will try and illustrate the answer
Subscribe to:
Post Comments (Atom)
Ranking and Unranking permutations
I've been a big fan of Skiena's Algorithm Design Manual , I recently found my first edition of the book (although I own the third ed...
-
(Photo from http://content-usa.cricinfo.com/indvaus2008/content/current/player/28114.html) Dravid's dismal form continues in test crick...
-
I've been reading up on Fast Fourier Transform (FFT) from several books on algorithms that I have, TCLR, Tamassia, Sahni, Numerical Rec...
-
The book is almost out there . There is code and selected solutions as well. The book is supposed to be in full colour from what I heard....
6 comments:
Gops had the correct answer. Once!
Indirectly you can do something like this :-
int i;
int *j;
int **k;
and so on;
&i
j=&i;&j
k=&j;&k and so on
Yes, thats correct. But the fact than you can take one address at a time still remains. To give a simple answer
& is the address operator
&& is the and operator
Won't it be infinite if use paranthesis, thusly : &(&(&(&var))) ?
-Vinay
Yes, Vinay, good point. We can use &(&a)), etc. But &(&(...)) is not a common operation as common as **...
For a given variable a on &a exists.
If int *p = &a, then &(&a) is not &p since "C" has no way of knowing all variables that could contain a pointer to a.
Post a Comment