when i say
*((&(A[5]))-3).value=7;
it the same as saying
*(A+2).value=7
??
when i say
*((&(A[5]))-3).value=7;
it the same as saying
*(A+2).value=7
??
I think so - but if you find code that does this sort of thing (or similar things), stay away!
--
Mats
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.
Why don't you write a simple program to check just that?
(Just for the record: Yes they will point to the same addr)Code:if ((&(A[5]))-3) == (A+2)) { printf ("same addr!\n"); } else { printf ("doh!\n"); }
Edit: I are the slowpoke!
Last edited by edoceo; 03-19-2009 at 02:19 PM. Reason: slow slow slow
but you said that i cant use & expression on the left side
only on the right
you said its rvalue
??
when i did
&t=&x
you said it wrong
but *((&(A[5]))-3).value=7; is ok??
ahh thanks
Which can be simplified furthur to just:Also, true you can't do &t = ...Code:A[2].value = 7;
but you already know you can do t = ...
AND you know that *&t is the same as t
therefore *&t = ... is fine.
It is also perfectly fine to gobecause that doesn't involve assignment.Code:if (&t == ...)
My homepage
Advice: Take only as directed - If symptoms persist, please see your debugger
Linus Torvalds: "But it clearly is the only right way. The fact that everybody else does it some other way only means that they are wrong"