System Programming MCQs with Answers
Practice important System Programming MCQs with answers and explanations.
Multiple Choice Questions
Q611: What type is the variable `pwdBuffer` declared as?
- A: char[]
- B: TCHAR[]
- C: string[]
- D: wchar_t[]
View Answer
B
Q612: What does the macro DIRNAME_LEN represent?
- A: Length of the file
- B: Length of input buffer
- C: Buffer size for directory path
- D: Length of output string
View Answer
C
Q613: The maximum length of the directory path is defined using which constant?
- A: MAX_BUFFER
- B: PATH_MAX
- C: MAX_PATH
- D: MAX_LEN
View Answer
C
Q614: The return type of GetCurrentDirectory is ______.
- A: BOOL
- B: DWORD
- C: int
- D: HANDLE
View Answer
B
Q615: Which function is used to print the current directory to the console?
- A: printf()
- B: WriteConsole()
- C: PrintMsg()
- D: ConsoleWrite()
View Answer
C
Q616: If GetCurrentDirectory returns 0, it indicates ______.
- A: success
- B: path exists
- C: empty string
- D: failure
View Answer
D
Q617: The function ReportError is used to ______.
- A: handle success
- B: case-switch blocks
- C: handle errors
- D: buffer strings
View Answer
C
Q618: Which handle is passed to PrintMsg in the example?
- A: GetInputHandle()
- B: GetErrorHandle()
- C: GetConsoleHandle()
- D: GetStdHandle()
View Answer
D
Q619: What is passed as the first argument to GetCurrentDirectory?
- A: pwdBuffer
- B: size of pwdBuffer
- C: DIRNAME_LEN
- D: size of current path
View Answer
C
Q620: Which preprocessor directive defines the buffer size in the code?
- A: #include
- B: #define
- C: #define MAX_PATH
- D: #define DIRNAME_LEN
View Answer
B