System Programming MCQs with Answers
Practice important System Programming MCQs with answers and explanations.
Chapter: 33
Q741:
Which structure is used to hold file size returned by GetFileSizeEx()?
A. FILEINFO
B. HANDLE
C. LARGE_INTEGER
D. READWRITE
Correct Answer:
C
Chapter: 33
Q742:
CreateFile must be used before calling
A. GetFileSizeEx
B. CloseFile
C. SetFilePointer
D. FlushFileBuffers
Correct Answer:
A
Chapter: 33
Q743:
SetEndOfFileEx can be used to
A. truncate or extend a file
B. copy a file
C. delete a file
D. read a file
Correct Answer:
A
Chapter: 33
Q744:
Increasing a file’s size before writing large data improves
A. memory usage
B. file handle management
C. performance
D. file locking
Correct Answer:
C
Chapter: 33
Q745:
If GetFileSizeEx fails, it returns
A. NULL
B. 1
D. Zero
Correct Answer:
C
Chapter: 33
Q746:
GetFileSizeEx takes how many arguments?
A. 1
B. 2
C. 3
D. 4
Correct Answer:
B
Chapter: 33
Q747:
To receive the file size, a pointer is passed to a ________ structure.
A. DWORD
B. QUADWORD
C. FILE_HANDLE
D. LARGE_INTEGER
Correct Answer:
D
Chapter: 33
Q748:
File size in bytes is received via which parameter of GetFileSizeEx()?
A. hFile
B. lpFileSize
C. fileName
D. offset
Correct Answer:
B
Chapter: 34
Q749:
What does a DWORD represent in the RECORD structure?
A. A 32-bit unsigned integer
B. A 16-bit signed integer
C. A 64-bit floating number
D. A character array
Correct Answer:
A
Chapter: 34
Q750:
In the given code, what does a referenceCount of 0 indicate in a RECORD?
A. The record is empty
B. The record is locked
C. The record is deleted
D. The record is full
Correct Answer:
A
Chapter: 34
Q751:
Which header field keeps track of the total number of records in the file?
A. numRecords
B. numNonEmptyRecords
C. referenceCount
D. recordCreationTime
Correct Answer:
A
Chapter: 34
Q752:
Which system time field in the RECORD struct represents the last time the record was accessed?
A. recordCreationTime
B. recordLastRefernceTime
C. recordUpdateTime
D. dataString
Correct Answer:
B
Chapter: 34
Q753:
What is the purpose of the CreateFile function in this code?
A. To create or open a file
B. To write data to a file
C. To read data from a file
D. To close a file
Correct Answer:
A
Chapter: 34
Q754:
What does the FILE_FLAG_RANDOM_ACCESS flag specify when opening a file?
A. Sequential access
B. Random access
C. Write-only
D. Read-only
Correct Answer:
B
Chapter: 34
Q755:
In the program, what happens if the record number entered is larger than the total records?
A. The program prompts to try again
B. The record is created automatically
C. The program deletes an old record
D. The program ignores the input
Correct Answer:
A
Chapter: 34
Q756:
What type is used to store the data string in each record?
A. TCHAR
B. char*
C. DWORD
D. RECORD
Correct Answer:
A
Chapter: 34
Q757:
What does the command 'r' do in this program?
A. Reads a record
B. Writes a record
C. Deletes a record
D. Quits the program
Correct Answer:
A
Chapter: 34
Q758:
What is checked immediately after opening the file handle (hFile)?
A. If the file was opened successfully
B. If the file contains data
C. If the file is empty
D. If the file is locked
Correct Answer:
A
Chapter: 34
Q759:
When deleting a record, what happens to the header's numNonEmptyRecords value?
A. It is decremented
B. It is incremented
C. It stays the same
D. It is reset to zero
Correct Answer:
A
Chapter: 34
Q760:
Which function is used to update the file pointer position?
A. SetFilePointerEx
B. SetFilePointer
C. MoveFile
D. SeekFile
Correct Answer:
A