System Programming MCQs with Answers
Practice important System Programming MCQs with answers and explanations.
Multiple Choice Questions
Q781: Which function adjusts the physical end of the file after setting the file pointer?
- A: SetEndOfFile
- B: SetFilePointer
- C: SetFileLength
- D: SetFileEnd
View Answer
A
Q782: When writing to the file, how is the offset for the record calculated?
- A: (LONGLONG)recNo * sizeof(RECORD) + sizeof(HEADER)
- B: recNo + sizeof(RECORD)
- C: recNo * sizeof(HEADER)
- D: recNo * sizeof(RECORD)
View Answer
A
Q783: What is the effect of the FILE_FLAG_RANDOM_ACCESS flag in file operations?
- A: Improves performance when accessing file randomly
- B: Improves sequential read speed
- C: Locks the file for exclusive access
- D: Enables write caching
View Answer
A
Q784: Which of the following statements is TRUE?
- A: The program can read, write, and delete records
- B: The program only reads records
- C: The program only writes records
- D: The program only deletes records
View Answer
A
Q785: What happens when a record is written for the first time?
- A: numNonEmptyRecords increments
- B: recordCreationTime updates
- C: referenceCount increments
- D: All of the above
View Answer
D
Q786: Which of these functions is NOT part of the program's error handling?
- A: ReportError
- B: ReadFile
- C: WriteFile
- D: ExitProgram
View Answer
D
Q787: Which Windows API function initiates a search for files or directories?
- A: FindNextFile
- B: FindClose
- C: FindFirstFile
- D: GetFileTime
View Answer
C
Q788: In the FindFirstFile() function, lpFileName parameter specifies the ________ path and filename.
- A: directory
- B: system
- C: file
- D: handle
View Answer
A
Q789: Wildcard characters used in FindFirstFile() include the asterisk (*) and ________.
- A: semicolon (?)
- B: question mark (?)
- C: ampersand (&)
- D: percent (%)
View Answer
B
Q790: The WIN32_FIND_DATA structure is used to ________.
- A: store file or directory information
- B: handle file permissions
- C: define file types
- D: track system time
View Answer
A