四、不同的程式語言有不同的參數傳遞方式。當某一個程序被呼叫時,呼叫的一方所列 出的參數與被呼叫的程序開端所列的參數,將一一相對應。假設有一程序 Test 定義 如下(其中,B 是一個全域變數(global variable)): Procedure Test (A)
A = 100;
Print the value of A;
Print the value of B. 試問
申論題內容
⑴如果參數以傳值方式(by value)傳送,則下面之程式片段執行後其輸出為何?
(5 分)而如果參數以傳址方式(by reference)傳送時又為何?(5 分)
B = 0.1;
Call the procedure Test with argument B;
Print the value of B.