Examly題庫立即開始練習
原住民族考試四等考試-電子工程類科計算機概要10523單選題

執行下列 C 程式後,輸出的數字為何? #include <stdio.h> int main(void) { int b[] = { 10, 20, 30, 40 }; int *bPtr = b+2; printf( "%d ", *(bPtr+1)+2 ); return 0; }

A42正確答案
B33
C32
D15
答案與詳解
A
正確答案
bPtr指向b[2],*(bPtr+1)取b[3]=40,再+2=42

為什麼答案是 A

bPtr = b+2 指向 b[2];bPtr+1 指向 b[3],解參考得 40;再加 2 得 42。正確。

考點:指標算術考點:位移誤判考點:起點誤判考點:干擾項
載入中…

計算機概要 相關題目

想練更多計算機概要考古題?

Examly 收錄 38 萬+ 道歷屆題目,每題都有像這樣的精選詳解。免費下載,立即開練。

Download on theApp Store即將推出Google Play
黑皮