System Programming MCQs with Answers
Practice important System Programming MCQs with answers and explanations.
Chapter: 10
Q281:
What happens if CopyFile() fails?
A. The system reboots
B. An error message is displayed using GetLastError()
C. The program creates a backup file
D. The program silently exits
Correct Answer:
B
Chapter: 10
Q282:
Which function is used to convert ASCII file names to Unicode before using CopyFile()?
A. StringToWide()
B. MultiByteToWideChar()
C. WideCharToMultiByte()
D. strconv()
Correct Answer:
B
Chapter: 10
Q283:
What does the third parameter of CopyFile() specify?
A. Whether to overwrite the file
B. Buffer size
C. The file size
D. The number of threads
Correct Answer:
A
Chapter: 10
Q284:
The error from CopyFile() is captured using which function?
A. GetFileError()
B. LastError()
C. GetLastError()
D. ReportError()
Correct Answer:
C
Chapter: 10
Q285:
The type of variables `lpwszFile1` and `lpwszFile2` is
A. DWORD
B. LPSTR
C. LPWSTR
D. HANDLE
Correct Answer:
C
Chapter: 10
Q286:
Which data type is used for storing length of converted strings?
A. INT
B. DWORD
C. CHAR
D. SHORT
Correct Answer:
A
Chapter: 10
Q287:
Convenience functions in Windows are designed to perform
A. Common tasks using multiple steps
B. Single low-level tasks
C. Multiple tasks using single call
D. Interrupt handling
Correct Answer:
C
Chapter: 10
Q288:
CopyFile() function internally uses which operations?
A. Open, write, and execute
B. Create, delete, copy
C. Create, open, read, write
D. Compile and link
Correct Answer:
C
Chapter: 10
Q289:
CopyFile() can overwrite existing files based on
A. Second argument
B. Return value
C. Third argument
D. Error flag
Correct Answer:
C
Chapter: 10
Q290:
The file paths provided to CopyFile() must be
A. Hexadecimal
B. Unicode
C. Binary
D. ASCII
Correct Answer:
B
Chapter: 10
Q291:
Which statement is true about CopyFile()?
A. It deletes the source file
B. It reads binary only
C. It supports Unicode paths
D. It compresses the file
Correct Answer:
C
Chapter: 10
Q292:
The program allocates memory for file names using
A. new()
B. GlobalAlloc()
C. malloc()
D. LocalAlloc()
Correct Answer:
C
Chapter: 10
Q293:
If incorrect arguments are passed, the program prints
A. Error: File not found
B. Usage: cp file1 file2
C. Error: Access denied
D. Error: Buffer overflow
Correct Answer:
B
Chapter: 10
Q294:
The return value 2 indicates that
A. CopyFile succeeded
B. The file was not found
C. CopyFile failed
D. File was locked
Correct Answer:
C
Chapter: 10
Q295:
The CopyFile() function belongs to which programming interface?
A. C Standard Library
B. POSIX API
C. Windows API
D. UNIX Shell
Correct Answer:
C
Chapter: 10
Q296:
The CopyFile() function returns FALSE when
A. File copied successfully
B. Function is not called
C. Copy fails
D. Function is undefined
Correct Answer:
C
Chapter: 10
Q297:
_________ function is a Windows convenience function for file copy.
A. ReadFile()
B. WriteFile()
C. CopyFile()
D. OpenFile()
Correct Answer:
C
Chapter: 10
Q298:
Windows convenience functions improve performance by
A. Reducing code size
B. Using threading
C. Combining multiple operations
D. Running in kernel mode
Correct Answer:
C
Chapter: 10
Q299:
The CopyFile function is defined in which header file?
A. windows.h
B. copyfile.h
C. stdio.h
D. winapi.h
Correct Answer:
A
Chapter: 11
Q300:
Which file system is known for providing security by restricting user access without privileges?
A. NTFS
B. FAT32
C. CDFS
D. UDF
Correct Answer:
A