System Programming MCQs with Answers
Practice important System Programming MCQs with answers and explanations.
Chapter: 32
Q721:
OVERLAPPED helps in setting the file pointer during which kind of file access?
A. synchronous
B. random
C. parallel
D. asynchronous
Correct Answer:
D
Chapter: 32
Q722:
The internal fields in OVERLAPPED are mainly used by
A. the developer
B. the system API
C. file reader
D. debugger
Correct Answer:
B
Chapter: 32
Q723:
OVERLAPPED structure allows advanced control over
A. file compression
B. memory paging
C. network sockets
D. file reading and writing
Correct Answer:
D
Chapter: 32
Q724:
Setting both Offset and OffsetHigh to -1 will make the file pointer move to
A. the file header
B. the current position
C. the file end
D. random location
Correct Answer:
C
Chapter: 32
Q725:
Which function call demonstrates the use of OVERLAPPED in reading?
A. ReadConsole(hFile, …)
B. ReadFile(hFile, buf, sizeof(buf), &nRead, &ov)
C. ReadData(buf, hFile, &ov)
D. ReadInput(hFile, buf)
Correct Answer:
B
Chapter: 32
Q726:
The WriteFile API can be used with OVERLAPPED by passing which parameter last?
A. &hEvent
B. &buf
C. &ov
D. &FilePointer
Correct Answer:
C
Chapter: 33
Q727:
Which API function is used to get the size of a file in Windows?
A. GetFileSize
B. GetFileLength
C. GetFileSizeEx
D. GetFileEnd
Correct Answer:
C
Chapter: 33
Q728:
To get file size using pointer movement, the file pointer must be moved to
A. Beginning
B. First sector
C. End of file
D. Middle of file
Correct Answer:
C
Chapter: 33
Q729:
What data type is used with GetFileSizeEx to store the file size?
A. DWORD
B. LONGLONG
C. LARGE_INTEGER
D. UINT64
Correct Answer:
C
Chapter: 33
Q730:
What is required for the file handle used with GetFileSizeEx()?
A. FILE_WRITE_ACCESS
B. FILE_EXECUTE
C. FILE_READ_ATTRIBUTES
D. FILE_APPEND_DATA
Correct Answer:
C
Chapter: 33
Q731:
What does the lpFileSize parameter of GetFileSizeEx represent?
A. File name
B. File pointer
C. File handle
D. Pointer to LARGE_INTEGER
Correct Answer:
D
Chapter: 33
Q732:
Which of the following allows direct resizing of a file in Windows?
A. GetFileSizeEx()
B. SetFileAttributes()
C. SetEndOfFileEx()
D. WriteFile()
Correct Answer:
C
Chapter: 33
Q733:
Moving the file pointer from start to end manually can give you the
A. file name
B. file attributes
C. file size
D. file extension
Correct Answer:
C
Chapter: 33
Q734:
What is the return type of GetFileSizeEx()?
A. INT
B. BOOL
C. HANDLE
D. VOID
Correct Answer:
B
Chapter: 33
Q735:
To get a valid result from GetFileSizeEx, the file must be
A. closed
B. empty
C. readable
D. and have FILE_READ_ATTRIBUTES
Correct Answer:
C
Chapter: 33
Q736:
The method of moving file pointer from start to end is used to
A. detect file type
B. compress file
C. measure file size
D. set file attributes
Correct Answer:
C
Chapter: 33
Q737:
To allow file size growth in advance, which function is used?
A. SetFileLength()
B. WriteFile()
C. SetEndOfFileEx()
D. SeekToEnd()
Correct Answer:
C
Chapter: 33
Q738:
Reducing file size using SetEndOfFileEx may result in
A. appending data
B. creating new file
C. truncating data
D. duplicating file
Correct Answer:
C
Chapter: 33
Q739:
A file pointer after opening a file using CreateFile() points to
A. the last byte of file
B. beginning of file
C. middle of file
D. end of file
Correct Answer:
B
Chapter: 33
Q740:
In file pointer method, file size is calculated by
A. subtracting end and start addresses
B. counting file handles
C. calling malloc()
D. measuring bytes copied
Correct Answer:
A