当前位置:网站首页>Operator priority, one catch, no doubt

Operator priority, one catch, no doubt

2022-07-05 06:15:00 Summer seaweed

Preface

The content is mainly for reference 《C A deep analysis of language 》

Operator priority

The use of priority can refer to the subscript table :
image
image
image

Be careful

In front of ++, After ++, Quoting *, Member variable accessors -> and . , Pay attention to their respective priorities , From the above table, we can get Member access operator . The highest priority , The second is Access operators -> The priority of the , ++ Priority is higher than Quoting * Operators have high priority

For the use of priority , There is no need to memorize , With the more , Write more and remember , Generally remember Multiplication and division The priority ratio Addition and subtraction Just be tall , Others that require multiple operators , Always use parentheses To emphasize priorities , This will not produce ambiguity , It is also convenient for later generations to read and understand .

There are also a few mistakes :
image
image

Last

Thanks for watching , Improve together , Slowly get stronger

原网站

版权声明
本文为[Summer seaweed]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202140619354001.html