0 — Test 584
Page 1 of 3
Question 1
What happens when memory allocated with new in C++ is never released with delete?
FPSC- Programmer (BS-17) - Pakistan Meteorological Department (PMD) Model Papers - 2026
Question 2
In C++, what is the result of using delete p; on memory allocated with p = new int[10];?
FPSC- Programmer (BS-17) - PMD High Yield - 2026
Question 3
What is wrong with this C++ function?
int* f(){ int x = 5; return &x; }
FPSC- Programmer (BS-17) - PMD High Yield - 2026
Question 4
How does CPython primarily manage memory?
FPSC- Programmer (BS-17) - Pakistan Meteorological Department (PMD) Model Papers - 2026
Question 5
Given int arr[5]; int *p = arr; with 4-byte ints, how many bytes does p + 2 advance from arr?
FPSC- Programmer (BS-17) - Pakistan Meteorological Department (PMD) Model Papers - 2026
Question 6
What happens when a null pointer is dereferenced in C++?
FPSC- Programmer (BS-17) - Pakistan Meteorological Department (PMD) Model Papers - 2026
Question 7
What does C's malloc return when the requested memory cannot be allocated?
FPSC- Programmer (BS-17) - Pakistan Meteorological Department (PMD) Model Papers - 2026
Question 8
In C++, Base *p = new Derived(); p->show(); is called and show() is NOT virtual. Which version runs?
FPSC- Programmer (BS-17) - PMD High Yield - 2026
Question 9
Which C++ members can be declared virtual?
FPSC- Programmer (BS-17) - Pakistan Meteorological Department (PMD) Model Papers - 2026
Question 10
What makes a C++ class abstract?
FPSC- Programmer (BS-17) - PMD High Yield - 2026