sam*_*oul 2 c++ variables operators
所以我的朋友给了我一些源代码,所以我可以回顾和理解它,我有一个问题,但由于他不在线,我想我会在这里尝试,主要是我不太明白这一行.
num += i;
Run Code Online (Sandbox Code Playgroud)
基本上,这是相同的
num = num + i
Run Code Online (Sandbox Code Playgroud)
对?
如果您需要更多细节请告诉我!我期待很快听到您的回复.
Pra*_*rav 11
来自ISO C++ 03(第5.17/7节)
The behavior of an expression of the form E1 op= E2 is equivalent to E1 = E1 op E2 except that E1 is evaluated only once.