System Programming MCQs with Answers
Practice important System Programming MCQs with answers and explanations.
Multiple Choice Questions
Q621: The second argument to GetCurrentDirectory is used for ______.
- A: file handle
- B: file size
- C: path length
- D: directory storage buffer
View Answer
D
Q622: What is the condition for "Pathname is too long" error?
- A: lenCurDir < 0
- B: lenCurDir == 0
- C: lenCurDir > DIRNAME_LEN
- D: lenCurDir == MAX_PATH
View Answer
C
Q623: PrintMsg is used to output ______ to the console.
- A: errors
- B: user input
- C: current directory
- D: directory list
View Answer
C
Q624: The macro MAX_PATH is used to define ______.
- A: maximum length of the filename
- B: maximum buffer for printf
- C: maximum size of file content
- D: maximum length of a directory path
View Answer
D
Q625: pwdBuffer is used to store the ______.
- A: command-line input
- B: output message
- C: current directory path
- D: console error message
View Answer
C
Q626: pwdBuffer contains ______ after a successful call to GetCurrentDirectory.
- A: error message
- B: current directory path
- C: error code
- D: empty string
View Answer
B
Q627: When lenCurDir > DIRNAME_LEN, the program will call ______.
- A: PrintMsg()
- B: ReportError()
- C: GetStdHandle()
- D: GetCurrentDirectory()
View Answer
B
Q628: lenCurDir is used to store the result of ______.
- A: PrintMsg()
- B: GetStdHandle()
- C: GetCurrentDirectory()
- D: ReportError()
View Answer
C
Q629: The code uses TCHAR for character type to support ______.
- A: only ASCII
- B: unicode and ANSI
- C: digits only
- D: alphabetic only
View Answer
B
Q630: GetStdHandle(STD_OUTPUT_HANDLE) returns handle to ______.
- A: console error
- B: device output
- C: console output
- D: file output
View Answer
C