System Programming MCQs with Answers
Practice important System Programming MCQs with answers and explanations.
Multiple Choice Questions
Q341: The dwFlagsAndAttributes parameter is used to specify _______.
- A: Security attributes
- B: File size
- C: File attributes and flags
- D: File handle
View Answer
C
Q342: The hTemplateFile parameter is used to _______.
- A: Specify file security
- B: Specify attributes to apply to new file
- C: Specify file size
- D: Specify access rights
View Answer
B
Q343: lpSecurityAttributes points to _______.
- A: File name structure
- B: File size structure
- C: Security attributes structure
- D: File handle structure
View Answer
C
Q344: Setting dwShareMode to FILE_SHARE_WRITE allows sharing the file for _______.
- A: Reading only
- B: Writing only
- C: Both reading and writing
- D: No sharing
View Answer
B
Q345: If CreateFile() fails to open or create a file, it returns _______.
- A: NULL
- B: -1
- C: INVALID_HANDLE_VALUE
- D: 0
View Answer
C
Q346: What is the purpose of the ReadFile() API?
- A: Read data from buffer to file
- B: Write data to file
- C: Read data from file to buffer
- D: Close a file
View Answer
C
Q347: If ReadFile() reaches the End of File, the number of bytes read is set to _______.
- A: -1
- B: 1
- C: 0
- D: EOF marker
View Answer
C
Q348: Which parameter of ReadFile() holds the file handle?
- A: lpBuffer
- B: hFile
- C: nNumberOfBytesToRead
- D: lpOverlapped
View Answer
B
Q349: The parameter lpBuffer in ReadFile() is used to _______.
- A: Store the file handle
- B: Store data read from the file
- C: Count bytes to read
- D: Control concurrent processing
View Answer
B
Q350: What does nNumberOfBytesToRead specify in ReadFile()?
- A: Number of bytes to write
- B: Number of bytes to read
- C: Buffer size
- D: Number of bytes read
View Answer
B