Skip to main content

System Programming MCQs with Answers

Practice important System Programming MCQs with answers and explanations.

Chapter: 34
Q781:
Which function adjusts the physical end of the file after setting the file pointer?
A. SetEndOfFile
B. SetFilePointer
C. SetFileLength
D. SetFileEnd
Correct Answer: A
Chapter: 34
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)
Correct Answer: A
Chapter: 34
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
Correct Answer: A
Chapter: 34
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
Correct Answer: A
Chapter: 34
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
Correct Answer: D
Chapter: 34
Q786:
Which of these functions is NOT part of the program's error handling?
A. ReportError
B. ReadFile
C. WriteFile
D. ExitProgram
Correct Answer: D
Chapter: 35
Q787:
Which Windows API function initiates a search for files or directories?
A. FindNextFile
B. FindClose
C. FindFirstFile
D. GetFileTime
Correct Answer: C
Chapter: 35
Q788:
In the FindFirstFile() function, lpFileName parameter specifies the ________ path and filename.
A. directory
B. system
C. file
D. handle
Correct Answer: A
Chapter: 35
Q789:
Wildcard characters used in FindFirstFile() include the asterisk (*) and ________.
A. semicolon (?)
B. question mark (?)
C. ampersand (&)
D. percent (%)
Correct Answer: B
Chapter: 35
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
Correct Answer: A
Chapter: 35
Q791:
Which member of WIN32_FIND_DATA stores the last time a file was accessed?
A. ftLastAccessTime
B. dwFileAttributes
C. nFileSizeLow
D. ftCreationTime
Correct Answer: A
Chapter: 35
Q792:
The FindNextFile() API requires a handle returned by which function?
A. FindClose
B. FindFirstFile
C. GetFileType
D. GetFileTime
Correct Answer: B
Chapter: 35
Q793:
FindClose() is used to ________ a search handle after completing a file search.
A. close
B. open
C. initialize
D. duplicate
Correct Answer: A
Chapter: 35
Q794:
FileTimeToSystemTime() API converts file time to ________ time.
A. system
B. local
C. file
D. network
Correct Answer: A
Chapter: 35
Q795:
SetFileTime() allows setting creation time, last access time, and ________ time.
A. file size
B. last write
C. file attributes
D. file type
Correct Answer: C
Chapter: 35
Q796:
GetFileAttributes() returns FILE_ATTRIBUTE_DIRECTORY to indicate a ________.
A. file
B. directory
C. read-only file
D. hidden file
Correct Answer: B
Chapter: 35
Q797:
The value 0xFFFFFFFF returned by GetFileAttributes() indicates ________.
A. success
B. failure
C. normal file
D. temporary file
Correct Answer: B
Chapter: 35
Q798:
dwFileAttributes in WIN32_FIND_DATA contains information about a file’s ________.
A. permissions
B. size
C. attributes
D. owner
Correct Answer: C
Chapter: 35
Q799:
Which of the following is NOT a member of WIN32_FIND_DATA?
A. dwReserved0
B. cAlternateFileName
C. dwFilePermissions
D. WFinderFlags
Correct Answer: C
Chapter: 35
Q800:
FindFirstFile() can search files using ________.
A. wildcard characters
B. only exact names
C. folder names
D. network paths
Correct Answer: A

Test Your Knowledge

Take a timed quiz on System Programming

🚀 Start Quiz Now