C++ MCQ : C++ Pointers into Arrays (MULTIPLE CHOICE QUESTIONS)

We have already covered C++ Arrays questions in the last set of MCQs. There, we have discussed some good questions. This set of MCQ focuses on the C++ Pointers into Arrays.

You can practice these interview questions to improve C++ programming skills needed for various interviews (like company interview, campus interview, walk-in interview), entrance exams, placements and other competitive exams. All the questions in this particular section are based on only “C++ Pointers into Arrays MCQ“.

Instructions to be followed:-

  1. Read all the questions carefully.
  2. Out of the 4 given options for each questions, only ONE option will be correct.
  3. Choose the appropriate option.
  4. After attempting all the questions, click on “Finish” button to check the score.
  5. Share your result on social media handles available.

If you are not satisfied with your result or wants to attempt the Quiz again, don’t worry, you can try it again at the end (by refreshing the page). You can use Previous and Next button to switch to a different set of questions.

C++ Pointers into Arrays MCQ
C++ Pointers into Arrays MCQ

C++ MCQ | POINTERS INTO ARRAYS

NOTE: You can check your answer immediately by selecting an option.

Now, start attempting the quiz.

C++ Pointers into Arrays MCQ

#1. What is the meaning of the following declaration?
int(*p[5])();

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

#3. What will be the output of the following C++ code?

#include
using namespace std;
int main()
{
    int arr[] = {4, 5, 6, 7};
    int *p = (arr + 1);
    cout << arr;
    return 0;
}

#4. What will be the output of the following C++ code?

#include <iostream>
using namespace std;
int main ()
{
     int numbers[5];
     int * p;
     p = numbers;
     *p = 10;
     p++;    *p = 20;
     p = &numbers[2];     *p = 30;
     p = numbers + 3;      *p = 40;
     p = numbers;      *(p + 4) = 50;
     for (int n = 0; n < 5; n++)
         cout << numbers[n] << ",";
     return 0;
}

#5. What will be the output of the following C++ code?

#include <iostream>
using namespace std;
int main()
{
    int a[2][4] = {3, 6, 9, 12, 15, 18, 21, 24};
    cout << *(a[1] + 2) << *(*(a + 1) + 2) << 2[1[a]];
    return 0;
}

#6. What will be the output of the following C++ code?

#include <iostream>
using namespace std;
int main()
{
     int arr[] = {4, 5, 6, 7};
     int *p = (arr + 1);
     cout << *arr + 9;
     return 0;
}

#7. What will be the output of the following C++ code?

#include <iostream>
using namespace std;
int main()
{
    int i;
    const char *arr[] = {"C", "C++", "Java", "VBA"};
    const char *(*ptr)[4] = &arr;
    cout << ++(*ptr)[2];
    return 0;
}

#8. What will be the output of the following C++ code?

#include <iostream>
using namespace std;
int main()
{
    int arr[] = {4, 5, 6, 7};
    int *p = (arr + 1);
    cout << *p;
    return 0;
}

#9. The declaration int (*p) [5]; means

Finish

Results

<< Prev- C++ MCQs : C++ Arrays – 2

>> Next- C++ MCQ : Operators


Are you curious to learn more about C++ Programming? If yes, then don’t forget to explore all the topics of C++ programming. Here, is the complete set of Multiple Choice Questions and Answers. These question sets are very helpful in preparing for Competitive Exams and University level exams.

Learn about 404 ERROR page – EVERYTHING YOU NEED TO KNOW ABOUT 404 ERROR PAGE FOR SEO

For frontend projects, check and implements these beginner’s friendly projects :- TOP 7 PROJECTS FOR BEGINNERS TO PRACTICE HTML & CSS SKILLS

Do practice of HTML questions :- Multiple choice questions on HTML

Do practice of C programming :- Multiple choice questions on C programming

Want backlinks to your website? If yes, then follow this article and get to know in very easy way. How You Can Create High Quality Backlinks In 2021?

All the answers in this set are correct. But in case, you find any typographical, grammatical or any other error in our site then kindly inform us. Don’t forget to provide the appropriate URL along with error description. So that we can easily correct it.

Thanks in advance.

For discussion about any question, join the below comment section. And get the solution of your query. Also, try to share your thoughts about the topics covered in this particular quiz.

Leave a Comment

Your email address will not be published. Required fields are marked *