System Programming MCQs with Answers
Practice important System Programming MCQs with answers and explanations.
Multiple Choice Questions
Q1391: In HeapAlloc(), the parameter dwBytes specifies _______.
- A: the size of heap handle
- B: the size of heap page
- C: the size of the block to allocate
- D: the return type of function
View Answer
C
Q1392: Which flag may raise STATUS_NO_MEMORY or STATUS_ACCESS_VIOLATION during memory allocation?
- A: HEAP_ZERO_MEMORY
- B: HEAP_NO_SERIALIZE
- C: HEAP_REALLOC_IN_PLACE_ONLY
- D: HEAP_GENERATE_EXCEPTIONS
View Answer
D
Q1393: GetLastError() cannot be used with which API on failure?
- A: HeapDestroy()
- B: HeapAlloc()
- C: HeapFree()
- D: HeapReAlloc()
View Answer
B
Q1394: Which function is used to deallocate a memory block in heap?
- A: HeapAlloc()
- B: HeapReAlloc()
- C: HeapFree()
- D: HeapDestroy()
View Answer
C
Q1395: The lpMem parameter in HeapFree() should be a pointer returned by _______.
- A: malloc()
- B: realloc()
- C: HeapAlloc() or HeapReAlloc()
- D: HeapDestroy()
View Answer
C
Q1396: Which flag in HeapAlloc() improves performance when serialization isn't required?
- A: HEAP_NO_SERIALIZE
- B: HEAP_ZERO_MEMORY
- C: HEAP_REALLOC_IN_PLACE_ONLY
- D: HEAP_CREATE_ENABLE_EXECUTE
View Answer
A
Q1397: The HeapFree() function returns FALSE on _______.
- A: success
- B: allocation
- C: error
- D: failure
View Answer
D
Q1398: The GetLastError() function can be used after failure of which heap API?
- A: HeapAlloc()
- B: HeapFree()
- C: HeapCreate()
- D: HeapReAlloc()
View Answer
B
Q1399: The HeapReAlloc() function is used to _______.
- A: allocate new memory block
- B: allocate multiple heaps
- C: reallocate memory block
- D: increase virtual memory
View Answer
C
Q1400: In HeapReAlloc(), the HEAP_REALLOC_IN_PLACE_ONLY flag ensures _______.
- A: memory will be freed
- B: memory lies contiguously
- C: memory is shared
- D: memory is uninitialized
View Answer
B