科目名稱:資訊系統 與網路導論 | 開課系所:資訊工程 學系 | 任課教師 |
吳坤熹 |
||
系所別: |
年級: |
學號: |
姓名: |
考試日期 |
2010.12.8 |
Open book; turn off computer & mobile phone
(考試時間: 16:30-16:45)
(10%) Determine
whether the following code has syntax erros or not. If it is correct,
predict its output. If it is incorrect, point out the mistake(s).
#include <iostream>
using std::cout;
using std::endl;
int main()
{
int a[] = { 1, 9, 6, 3};
int* pa = a;
pa++;
*(++pa) += *(pa + 1);
for (int i=0; i < sizeof(a)/sizeof(a[0]); i++)
cout << a[i];
cout << endl;
return 0;
}