2012-07-05 72 views
0

在C#中,如果我在下列情況下的輸出是什麼是按順序執行的函數中的參數嗎?

int i=0; 
public int current_I(){return i;} 
public int next_I(){return ++i;} 
//--------- 
print(next_I(),current_I()); 
換句話說

我們可以知道哪些功能將首先執行具有的功能,打印它被假定它稱爲打印兩個值... { current_I或next_I}或者就像C++一樣,我們永遠不會知道參數的執行順序?

+0

重複http://stackoverflow.com/questions/1215236/c-order-of-function-evaluation-vs-c? – reuben 2012-07-05 10:17:12

+0

當你運行這段代碼時你得到了什麼? – V4Vendetta 2012-07-05 10:17:42

+0

@ V4Vendetta,OP會得到兩個1,我只能猜測'print'函數的作用;-) – Jodrell 2012-07-05 10:20:10

回答

相關問題