MCQs
In this program, we are adding the value 9 to the initial value of the array, So it’s printing as 13.
Output:
$ g++ point5.cpp
$ a.out
13
In this program, we are just assigning a value to the array and printing it and immediately dereferencing it.
Output:
$ g++ point4.cpp
$ a.out
10,20,30,40,50,
As we couted to print only arr, it will print the address of the array.
Output:
$ g++ point2.cpp
$ a.out
0xbfb1cff
In this program, we are making the pointer point to next value and printing it.
$ g++ point3.cpp
$ a.out
5
In this program we are moving the pointer from first position to second position and printing the
remaining value.
Output:
$ g++ point1.cpp
$ a.out
ava
Size of any type of pointer is 4 bytes in 32-bit platforms.
a[1][2] means 1 * (4)+2 = 6th element of an array staring from zero.
Output:
$ g++ point.cpp
$ a.out
21 21 21
In the above declaration the variable p is array not pointer.