11. T/F. Given:
struct prs
{
char name[30];
int num;
} ;
it is acceptable to define and initialize a
variable at compile time thus:
struct prs agent = {"James Bond", 007};
12. T/F. C++ string objects can grow larger or smaller
as they are used.
13. T/F. The switch() produces faster-executing
code than several if()'s.
14. When processing array data, you will most often use:
a. while loops
b. for loops
c. do while loops
d. typecasts
e. none of these are related to arrays
15. Given:
int a[10][5] ;
to access the second item in the
3rd row, we would use:
a. a[2][3] ;
b. a[3][2] ;
c. *(*(a+3)+2) ;
d. *(*(a+2)+1) ;
e. none above
16. The #ifdef, #elif, #else, and #endif
constructs are used to:
a. decide what code the compiler includes in the program
b. control program execution at run time
c. pass arguments back to Windows ( or other O/S) during program execution
d. both a and c above
e. all of the above
17. In C standard library I/O, the function
used to close a file after writing it is:
a. fclose()
b. close()
c. unlink()
d. chmod()
e. none above
18. In C++ fstream I/O, the function used
to close a stream after writing to it is:
a. stream.exit()
b. stream.rewind()
c. stream.octet()
d. stream.close()
e. stream.release()
19. T/F. The printf() family of functions can translate
between decimal, Hexadecimal, and Octal.
20. T/F. The main reason to prefer open() /
read() / write() over fopen() fread() /
fwrite() is speed of execution
21. The wchar_t data type is for storing:
a. graphics
b. ASCII
c. Unicode
d. large objects
e. none of these
2007-02-02 02:22:22 · 1 個解答 · 發問者 kenkun 1 in 電腦與網際網路 ➔ 程式設計
11. 錯誤。
007 只能當成字串
12.正確。
13.正確。
switch 執行效率高於 if
14. (a) (b) (c)
typecasts 是用來轉換型態,我想也可以選 (d)
如果為單選,選 (b)
15.(d)
第三列的第二項
16.(a)
前置處理器的條件式編譯指令
17.(a)
關檔函式 fclose()
18.(a)
關閉檔案串流函式
19.正確。
可以轉換十進制、十六進制、八進制
20.F (看不太懂 prefer...over...)
fopen() 執行速度快
21.(c)
wchar_t 是用在 Unicode 的字元處理
2007-02-02 12:33:58 · answer #1 · answered by Big_John-tw 7 · 0⤊ 0⤋