Q.
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;
} Similar Questions
1.
Which of the following is the proper declaration of a pointer ?
2.
Which of the following gives the memory address of integer variable a ?
3.
Which of the following gives the memory address of a pointer a ?
4.
Which of the following gives the value stored at the address pointed to by the pointer a ?
5.
Which of the following is the proper keyword to allocate memory ?
6.
Which of the following is the proper keyword to deallocate memory ?
7.
What does the following statement mean ?
8.
The operator used for dereferencing or indirection is ____
9.
Choose the right option.
string* x, y;
10.
Which one of the following is not a possible state for a pointer.
PROGRAMMING IN C++ TOPICS