It:
*(1 + &foo)
same as this?
*(&foo + 1)
'+' and '&' have the same priority, and they are evaluated from right to left. However, you cannot interpret the second case as follows:
*(&(foo + 1))
... because you can only use '&' with an l-value (it won’t even compile if you write it like that). So will it be rubbish? Or will he safely find out what you had in mind?
Yes, they are equivalent (the third, obviously, no).
& , + ( ), &foo + 1 (&foo) + 1. , , , , + ( ) , &.
&
+
&foo + 1
(&foo) + 1
, . , + , &. , +.
, & + + - , a - +b.
a - +b
When interpreted +as a binary operator, it has a lower priority than &, therefore, the second case will be interpreted as *((&foo) + 1), rather than *(&(foo + 1)).
*((&foo) + 1)
Source: https://habr.com/ru/post/1788073/More articles:Этот эффект возможен с помощью php-кода без специального программного обеспечения - phpCan GD make the text distorted (so that it looks like it slightly flows around the curve)? - phpHow to integrate Xcode with SVN - version-controlSearch C # generics / delegate katas - c # -4.0awk to perl conversion - awkwhere does my css come from? - htmlhttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1788075/is-wpf-a-good-technology-for-software-engineers-to-learn&usg=ALkJrhibzLpCwtbbVi-GOKFUhal-xR73Ywpython and mechanize - view options in a select box - pythonIs minWidth ignored in flex 3.5? - flexMake lowercase lowercase XSLT - xsltAll Articles