System Programming MCQs with Answers
Practice important System Programming MCQs with answers and explanations.
Multiple Choice Questions
Q2181: Which Windows API allows the temporary file handle to be inheritable?
- A: CreateFile() with SECURITY_ATTRIBUTES
- B: CreateFileMapping()
- C: CloseHandle()
- D: CreateEvent()
View Answer
A
Q2182: What will happen if argc < 3?
- A: Error message shown
- B: Program runs normally
- C: Program searches current directory
- D: Program crashes
View Answer
A
Q2183: How does the program handle spaces in file names?
- A: Quotes the filenames
- B: Removes spaces
- C: Replaces spaces with underscores
- D: Skips files with spaces
View Answer
A
Q2184: In the code, what is the role of _stprintf()?
- A: Formats command line string
- B: Reads input
- C: Opens files
- D: Deletes files
View Answer
A
Q2185: What does the min() function in WaitForMultipleObjects do?
- A: Ensures max handles per wait
- B: Counts processes
- C: Calculates elapsed time
- D: Checks exit codes
View Answer
A
Q2186: Which function is used to get the exit code of a process?
- A: GetExitCodeProcess()
- B: GetProcessStatus()
- C: CheckExitCode()
- D: VerifyProcess()
View Answer
A
Q2187: Which function waits for a single process to finish?
- A: WaitForSingleObject()
- B: WaitProcess()
- C: WaitOne()
- D: WaitProcessEnd()
View Answer
A
Q2188: What is the data type of 'hProc'?
- A: Pointer to process handles
- B: Pointer to files
- C: Pointer to threads
- D: Pointer to integers
View Answer
A
Q2189: How are errors communicated to the user?
- A: ReportError() function
- B: Exit codes
- C: Print to console
- D: Log file
View Answer
A
Q2190: If CreateProcess() fails, what does the program do?
- A: Calls ReportError()
- B: Continues silently
- C: Retries automatically
- D: Exits with code 0
View Answer
A