Skip to main content

Pointers And References In C Plus Plus — Part 1 MCQs with Explanations

Practice high-yield Programming & Software Development MCQs on Pointers And References In C Plus Plus — Part 1 with worked academic solutions for FPSC, PPSC, NTS, NITB, PTS.

Questions
40
Difficulty Level
Exam-Level
Target Exams
FPSC, PPSC, NTS...
Estimated Time
48 mins
Exam-Level FPSC PPSC NTS NITB PTS
Verified for Commission Syllabus • Oct 14, 2026
40

Verified Practice Questions

Interactive test mode with detailed academic worked solutions

Live Progress | 0/40 answered
✓ 0 correct ✗ 0 wrong 0% score
Question 1 of 40
★ FPSC ★ PPSC

What is a pointer in C++?

Question 2 of 40
★ FPSC ★ PPSC

How do you declare a pointer variable in C++?

Question 3 of 40
★ FPSC ★ PPSC

What is the output of the following code: int x = 5; int *ptr = &x; cout << *ptr; in C++?

Question 4 of 40
★ FPSC ★ PPSC

What is the correct syntax to dereference a pointer in C++?

Question 5 of 40
★ FPSC ★ PPSC

What is the purpose of the 'nullptr' keyword in C++?

Question 6 of 40
★ FPSC ★ PPSC

What does the 'nullptr' keyword replace in C++11 and later versions?

Question 7 of 40
★ FPSC ★ PPSC

What is the purpose of the 'reference' in C++?

Question 8 of 40
★ FPSC ★ PPSC

What is the output of the following code: int x = 5; int &ref = x; cout << ref; in C++?

Question 9 of 40
★ FPSC ★ PPSC

What happens when a reference is declared but not initialized in C++?

Question 10 of 40
★ FPSC ★ PPSC

How do you declare a reference variable in C++?

Question 11 of 40
★ FPSC ★ PPSC

What is the purpose of a null pointer in C++?

Question 12 of 40
★ FPSC ★ PPSC

What is the output of the following code: int arr[3] = {1, 2, 3}; int *ptr = arr; cout << *(ptr + 1); in C++?

Question 13 of 40
★ FPSC ★ PPSC

What is a dangling pointer in C++?

Question 14 of 40
★ FPSC ★ PPSC

What is the address-of operator in C++?

Question 15 of 40
★ FPSC ★ PPSC

What is the output of the following code: int arr[] = {1, 2, 3}; cout << *arr; in C++?

Question 16 of 40
★ FPSC ★ PPSC

How do you declare a constant pointer to an integer variable in C++?

Question 17 of 40
★ FPSC ★ PPSC

What is a pointer to a pointer known as in C++?

Question 18 of 40
★ FPSC ★ PPSC

What does the 'new' keyword do in C++?

Question 19 of 40
★ FPSC ★ PPSC

What is a null reference in C++?

Question 20 of 40
★ FPSC ★ PPSC

What is the output of the following code: int x = 10; int *ptr = &x; cout << *ptr << " " << ptr; in C++?

Question 21 of 40
★ FPSC ★ PPSC

What is the correct way to pass a pointer to a function in C++?

Question 22 of 40
★ FPSC ★ PPSC

What is a memory leak in C++?

Question 23 of 40
★ FPSC ★ PPSC

What is the purpose of the 'delete' keyword in C++?

Question 24 of 40
★ FPSC ★ PPSC

What does the 'nullptr' keyword signify when used as a pointer value in C++?

Question 25 of 40
★ FPSC ★ PPSC

What is a pointer arithmetic in C++?

Question 26 of 40
★ FPSC ★ PPSC

What is the purpose of the 'this' pointer in C++?

Question 27 of 40
★ FPSC ★ PPSC

What does the 'sizeof' operator return when used with a pointer variable in C++?

Question 28 of 40
★ FPSC ★ PPSC

What is the purpose of the 'const' keyword in a pointer declaration in C++?

Question 29 of 40
★ FPSC ★ PPSC

What is the output of the following code: int arr[3] = {1, 2, 3}; cout << *(arr + 2); in C++?

Question 30 of 40
★ FPSC ★ PPSC

What will be the output of the following C++ code? #include <iostream> using namespace std; int main() { int const p = 5; cout << ++p; return 0; }

Question 31 of 40
★ FPSC ★ PPSC

What we can't do on a void pointer?

Question 32 of 40
★ FPSC ★ PPSC

Choose the right option. string* x, y;

Question 33 of 40
★ FPSC ★ PPSC

What is size of generic pointer in C++ (in 32-bit platform)?

Question 34 of 40
★ FPSC ★ PPSC

What will be the output of the following C++ code? #include <iostream> using namespace std; int main() { int n = 5; void *p = &n; int *pi = static_cast<int*>(p); cout << *pi << endl; return 0; }

Question 35 of 40
★ FPSC ★ PPSC

What will be the output of the following C++ code? #include <iostream> #include <string> #include <cstdlib> using namespace std; int main(int argc, char const *argv[]) { int a = 5; int &p = a; cout<<p; return 0; }

Question 36 of 40
★ FPSC ★ PPSC

The correct statement for a function that takes pointer to a float, a pointer to a pointer to a char and returns a pointer to a pointer to a integer is . . . . . . . .

Question 37 of 40
★ FPSC ★ PPSC

What will be the output of the following C++ code? #include <iostream> using namespace std; void print (char * a) { cout << a << endl; } int main () { const char * a = "Hello world"; print(const_cast (a) ); return 0; }

Question 38 of 40
★ FPSC ★ PPSC

Identify the incorrect statement.

Question 39 of 40
★ FPSC ★ PPSC

Which of the following function must use reference.

Question 40 of 40
★ FPSC ★ PPSC

How are the constants declared?

✓ Link copied to clipboard
Continue Your Practice

Advance Html — Part 1

Master the next curriculum module with 40 exam-standard MCQs.

Next Practice Set →

💡 Examiner's Advisory for Programming & Software Development

In competitive commission exams (FPSC, PPSC, KPPSC, SPSC, CSS, PMS), questions are frequently phrased with distractor options designed to catch rote learners. Whenever you answer an MCQ, read the Detailed Academic Explanation and Conceptual Anchor to understand why the remaining options are incorrect.

More Modules in Programming & Software Development

View All →
📚

Study Guides

Topic summaries and syllabus breakdown

Explore Guides →
🎯

Complete Library

Search through 78,000+ verified MCQs

Browse Library →
📱

Mobile App

Offline mock tests and instant bookmarks

Get Mobile App →