![](/img/trans.png)
[英]Can you tell me how comparison works, type operator == (arguments)
[英]Can you tell me how the code given reachs to that output?
代碼的輸出是 30。但我不確定它是如何實現的。
#include <iostream>
int &fun()
{
static int x = 10;
return x;
}
int main()
{
fun() = 30;
std::cout << fun();
return 0;
}
我期望輸出為 10,但顯示為 30。如何?
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.