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
🎉 Set complete! All 40 questions answered.
Question 1 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is a pointer in C++?
Correct Answer: Option B — A variable that stores the address of another variable
Detailed Academic Explanation:
A variable that stores the address of another variable is the correct answer to “What is a pointer in C++”. This question is standard in competitive examination syllabi for Pointers And References In C Plus Plus.
💡Key Conceptual Anchor:Pointers And References In C Plus Plus
Question 2 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
How do you declare a pointer variable in C++?
Correct Answer: Option C — type *ptr
Detailed Academic Explanation:
type *ptr is the correct answer to “How do you declare a pointer variable in C++”. This question is standard in competitive examination syllabi for Pointers And References In C Plus Plus.
💡Key Conceptual Anchor:Pointers And References In C Plus Plus
Question 3 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the output of the following code: int x = 5; int *ptr = &x; cout << *ptr; in C++?
Correct Answer: Option D — 5
Detailed Academic Explanation:
5 is the correct answer to “What is the output of the following code: int x = 5; int *ptr = &x; cout << *ptr; in C++”. This question is standard in competitive examination syllabi for Pointers And References In C Plus Plus.
💡Key Conceptual Anchor:Pointers And References In C Plus Plus
Question 4 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the correct syntax to dereference a pointer in C++?
Correct Answer: Option A — *ptr
Detailed Academic Explanation:
*ptr is the correct answer to “What is the correct syntax to dereference a pointer in C++”. This question is standard in competitive examination syllabi for Pointers And References In C Plus Plus.
💡Key Conceptual Anchor:Pointers And References In C Plus Plus
Question 5 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the purpose of the 'nullptr' keyword in C++?
Correct Answer: Option D — Represents a null pointer
Detailed Academic Explanation:
Represents a null pointer is the correct answer to “What is the purpose of the 'nullptr' keyword in C++”. This question is standard in competitive examination syllabi for Pointers And References In C Plus Plus.
💡Key Conceptual Anchor:Pointers And References In C Plus Plus
Question 6 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What does the 'nullptr' keyword replace in C++11 and later versions?
Correct Answer: Option C — NULL pointer
Detailed Academic Explanation:
NULL pointer is the correct answer to “What does the 'nullptr' keyword replace in C++11 and later versions”. This question is standard in competitive examination syllabi for Pointers And References In C Plus Plus.
💡Key Conceptual Anchor:Pointers And References In C Plus Plus
Question 7 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the purpose of the 'reference' in C++?
Correct Answer: Option B — Alias to an existing variable
Detailed Academic Explanation:
Alias to an existing variable is the correct answer to “What is the purpose of the 'reference' in C++”. This question is standard in competitive examination syllabi for Pointers And References In C Plus Plus.
💡Key Conceptual Anchor:Pointers And References In C Plus Plus
Question 8 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the output of the following code: int x = 5; int &ref = x; cout << ref; in C++?
Correct Answer: Option C — 5
Detailed Academic Explanation:
5 is the correct answer to “What is the output of the following code: int x = 5; int &ref = x; cout << ref; in C++”. This question is standard in competitive examination syllabi for Pointers And References In C Plus Plus.
💡Key Conceptual Anchor:Pointers And References In C Plus Plus
Question 9 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What happens when a reference is declared but not initialized in C++?
Correct Answer: Option D — Compilation error
Detailed Academic Explanation:
Compilation error is the correct answer to “What happens when a reference is declared but not initialized in C++”. This question is standard in competitive examination syllabi for Pointers And References In C Plus Plus.
💡Key Conceptual Anchor:Pointers And References In C Plus Plus
Question 10 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
How do you declare a reference variable in C++?
Correct Answer: Option A — type &ref
Detailed Academic Explanation:
type &ref is the correct answer to “How do you declare a reference variable in C++”. This question is standard in competitive examination syllabi for Pointers And References In C Plus Plus.
💡Key Conceptual Anchor:Pointers And References In C Plus Plus
Question 11 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the purpose of a null pointer in C++?
Correct Answer: Option D — Represents that the pointer does not point to a valid object
Detailed Academic Explanation:
Represents that the pointer does not point to a valid object is the correct answer to “What is the purpose of a null pointer in C++”. This question is standard in competitive examination syllabi for Pointers And References In C Plus Plus.
💡Key Conceptual Anchor:Pointers And References In C Plus Plus
Question 12 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the output of the following code: int arr[3] = {1, 2, 3}; int *ptr = arr; cout << *(ptr + 1); in C++?
Correct Answer: Option C — 2
Detailed Academic Explanation:
2 is the correct answer to “What is the output of the following code: int arr[3] = {1, 2, 3}; int *ptr = arr; cout << *(ptr + 1); in C++”. This question is standard in competitive examination syllabi for Pointers And References In C Plus Plus.
💡Key Conceptual Anchor:Pointers And References In C Plus Plus
Question 13 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is a dangling pointer in C++?
Correct Answer: Option B — A pointer that points to a deallocated memory
Detailed Academic Explanation:
A pointer that points to a deallocated memory is the correct answer to “What is a dangling pointer in C++”. This question is standard in competitive examination syllabi for Pointers And References In C Plus Plus.
💡Key Conceptual Anchor:Pointers And References In C Plus Plus
Question 14 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the address-of operator in C++?
Correct Answer: Option D — &
Detailed Academic Explanation:
& is the correct answer to “What is the address-of operator in C++”. This question is standard in competitive examination syllabi for Pointers And References In C Plus Plus.
💡Key Conceptual Anchor:Pointers And References In C Plus Plus
Question 15 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the output of the following code: int arr[] = {1, 2, 3}; cout << *arr; in C++?
Correct Answer: Option A — 1
Detailed Academic Explanation:
1 is the correct answer to “What is the output of the following code: int arr[] = {1, 2, 3}; cout << *arr; in C++”. This question is standard in competitive examination syllabi for Pointers And References In C Plus Plus.
💡Key Conceptual Anchor:Pointers And References In C Plus Plus
Question 16 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
How do you declare a constant pointer to an integer variable in C++?
Correct Answer: Option D — int *const ptr
Detailed Academic Explanation:
int *const ptr is the correct answer to “How do you declare a constant pointer to an integer variable in C++”. This question is standard in competitive examination syllabi for Pointers And References In C Plus Plus.
💡Key Conceptual Anchor:Pointers And References In C Plus Plus
Question 17 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is a pointer to a pointer known as in C++?
Correct Answer: Option C — Double pointer
Detailed Academic Explanation:
Double pointer is the correct answer to “What is a pointer to a pointer known as in C++”. This question is standard in competitive examination syllabi for Pointers And References In C Plus Plus.
💡Key Conceptual Anchor:Pointers And References In C Plus Plus
Question 18 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What does the 'new' keyword do in C++?
Correct Answer: Option B — Allocates memory dynamically
Detailed Academic Explanation:
Allocates memory dynamically is the correct answer to “What does the 'new' keyword do in C++”. This question is standard in competitive examination syllabi for Pointers And References In C Plus Plus.
💡Key Conceptual Anchor:Pointers And References In C Plus Plus
Question 19 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is a null reference in C++?
Correct Answer: Option C — A reference that doesn't refer to any object
Detailed Academic Explanation:
A reference that doesn't refer to any object is the correct answer to “What is a null reference in C++”. This question is standard in competitive examination syllabi for Pointers And References In C Plus Plus.
💡Key Conceptual Anchor:Pointers And References In C Plus Plus
Question 20 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the output of the following code: int x = 10; int *ptr = &x; cout << *ptr << " " << ptr; in C++?
Correct Answer: Option D — 10 Address of x
Detailed Academic Explanation:
10 Address of x is the correct answer to “What is the output of the following code: int x = 10; int *ptr = &x; cout << *ptr << " " << ptr; in C++”. This question is standard in competitive examination syllabi for Pointers And References In C Plus Plus.
💡Key Conceptual Anchor:Pointers And References In C Plus Plus
Question 21 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the correct way to pass a pointer to a function in C++?
Correct Answer: Option A — By reference
Detailed Academic Explanation:
By reference is the correct answer to “What is the correct way to pass a pointer to a function in C++”. This question is standard in competitive examination syllabi for Pointers And References In C Plus Plus.
💡Key Conceptual Anchor:Pointers And References In C Plus Plus
Question 22 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is a memory leak in C++?
Correct Answer: Option D — Failure to deallocate memory after it's no longer needed
Detailed Academic Explanation:
Failure to deallocate memory after it's no longer needed is the correct answer to “What is a memory leak in C++”. This question is standard in competitive examination syllabi for Pointers And References In C Plus Plus.
💡Key Conceptual Anchor:Pointers And References In C Plus Plus
Question 23 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the purpose of the 'delete' keyword in C++?
Correct Answer: Option C — Deallocates memory dynamically
Detailed Academic Explanation:
Deallocates memory dynamically is the correct answer to “What is the purpose of the 'delete' keyword in C++”. This question is standard in competitive examination syllabi for Pointers And References In C Plus Plus.
💡Key Conceptual Anchor:Pointers And References In C Plus Plus
Question 24 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What does the 'nullptr' keyword signify when used as a pointer value in C++?
Correct Answer: Option B — A null pointer
Detailed Academic Explanation:
A null pointer is the correct answer to “What does the 'nullptr' keyword signify when used as a pointer value in C++”. This question is standard in competitive examination syllabi for Pointers And References In C Plus Plus.
💡Key Conceptual Anchor:Pointers And References In C Plus Plus
Question 25 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is a pointer arithmetic in C++?
Correct Answer: Option C — Performing arithmetic operations on pointers
Detailed Academic Explanation:
Performing arithmetic operations on pointers is the correct answer to “What is a pointer arithmetic in C++”. This question is standard in competitive examination syllabi for Pointers And References In C Plus Plus.
💡Key Conceptual Anchor:Pointers And References In C Plus Plus
Question 26 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the purpose of the 'this' pointer in C++?
Correct Answer: Option D — Points to the current object instance
Detailed Academic Explanation:
Points to the current object instance is the correct answer to “What is the purpose of the 'this' pointer in C++”. This question is standard in competitive examination syllabi for Pointers And References In C Plus Plus.
💡Key Conceptual Anchor:Pointers And References In C Plus Plus
Question 27 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What does the 'sizeof' operator return when used with a pointer variable in C++?
Correct Answer: Option B — Size of the data type pointed to by the pointer
Detailed Academic Explanation:
Size of the data type pointed to by the pointer is the correct answer to “What does the 'sizeof' operator return when used with a pointer variable in C++”. This question is standard in competitive examination syllabi for Pointers And References In C Plus Plus.
💡Key Conceptual Anchor:Pointers And References In C Plus Plus
Question 28 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the purpose of the 'const' keyword in a pointer declaration in C++?
Correct Answer: Option B — Indicates that the value pointed to is constant
Detailed Academic Explanation:
Indicates that the value pointed to is constant is the correct answer to “What is the purpose of the 'const' keyword in a pointer declaration in C++”. This question is standard in competitive examination syllabi for Pointers And References In C Plus Plus.
💡Key Conceptual Anchor:Pointers And References In C Plus Plus
Question 29 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the output of the following code: int arr[3] = {1, 2, 3}; cout << *(arr + 2); in C++?
Correct Answer: Option C — 3
Detailed Academic Explanation:
3 is the correct answer to “What is the output of the following code: int arr[3] = {1, 2, 3}; cout << *(arr + 2); in C++”. This question is standard in competitive examination syllabi for Pointers And References In C Plus Plus.
💡Key Conceptual Anchor:Pointers And References In C Plus Plus
Question 30 of 40
★ FPSC
★ PPSC
★ 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; }
Correct Answer: Option C — Error
Detailed Academic Explanation:
Error is the correct answer to “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; }”. This question is standard in competitive examination syllabi for Pointers And References In C Plus Plus.
💡Key Conceptual Anchor:Pointers And References In C Plus Plus
Question 31 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What we can't do on a void pointer?
Correct Answer: Option A — pointer arithmetic
Detailed Academic Explanation:
pointer arithmetic is the correct answer to “What we can't do on a void pointer”. This question is standard in competitive examination syllabi for Pointers And References In C Plus Plus.
💡Key Conceptual Anchor:Pointers And References In C Plus Plus
Question 32 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Choose the right option. string* x, y;
Correct Answer: Option A — x is a pointer to a string, y is a string
Detailed Academic Explanation:
x is a pointer to a string, y is a string is the correct answer to “Choose the right option. string* x, y;”. This question is standard in competitive examination syllabi for Pointers And References In C Plus Plus.
💡Key Conceptual Anchor:Pointers And References In C Plus Plus
Question 33 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is size of generic pointer in C++ (in 32-bit platform)?
Correct Answer: Option B — 4
Detailed Academic Explanation:
4 is the correct answer to “What is size of generic pointer in C++ (in 32-bit platform)”. This question is standard in competitive examination syllabi for Pointers And References In C Plus Plus.
💡Key Conceptual Anchor:Pointers And References In C Plus Plus
Question 34 of 40
★ FPSC
★ PPSC
★ 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; }
Correct Answer: Option A — 5
Detailed Academic Explanation:
5 is the correct answer to “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; }”. This question is standard in competitive examination syllabi for Pointers And References In C Plus Plus.
💡Key Conceptual Anchor:Pointers And References In C Plus Plus
Question 35 of 40
★ FPSC
★ PPSC
★ 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; }
Correct Answer: Option A — 5
Detailed Academic Explanation:
5 is the correct answer to “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; }”. This question is standard in competitive examination syllabi for Pointers And References In C Plus Plus.
💡Key Conceptual Anchor:Pointers And References In C Plus Plus
Question 36 of 40
★ FPSC
★ PPSC
★ 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 . . . . . . . .
Correct Answer: Option C — int **fun(float*, char**)
Detailed Academic Explanation:
int **fun(float*, char**) is the correct answer to “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 . . . . . . . .”. This question is standard in competitive examination syllabi for Pointers And References In C Plus Plus.
💡Key Conceptual Anchor:Pointers And References In C Plus Plus
Question 37 of 40
★ FPSC
★ PPSC
★ 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; }
Correct Answer: Option A — Hello world
Detailed Academic Explanation:
Hello world is the correct answer to “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; }”. This question is standard in competitive examination syllabi for Pointers And References In C Plus Plus.
💡Key Conceptual Anchor:Pointers And References In C Plus Plus
Question 38 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Identify the incorrect statement.
Correct Answer: Option B — A reference value once defined can be reassigned
Detailed Academic Explanation:
A reference value once defined can be reassigned is the correct answer to “Identify the incorrect statement.”. This question is standard in competitive examination syllabi for Pointers And References In C Plus Plus.
💡Key Conceptual Anchor:Pointers And References In C Plus Plus
Question 39 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of the following function must use reference.
Correct Answer: Option B — Copy Constructor
Detailed Academic Explanation:
Copy Constructor is the correct answer to “Which of the following function must use reference.”. This question is standard in competitive examination syllabi for Pointers And References In C Plus Plus.
💡Key Conceptual Anchor:Pointers And References In C Plus Plus
Question 40 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
How are the constants declared?
Correct Answer: Option C — both const keyword and #define preprocessor
Detailed Academic Explanation:
both const keyword and #define preprocessor is the correct answer to “How are the constants declared”. This question is standard in competitive examination syllabi for Pointers And References In C Plus Plus.
💡Key Conceptual Anchor:Pointers And References In C Plus Plus
✓Link copied to clipboard
Continue Your Practice
Advance Html — Part 1
Master the next curriculum module with 40 exam-standard MCQs.
💡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.