MCQs
None.
It operates on a pointer variable, and returns an l-value equivalent to the value at the pointer address.
Answer:(a)
Explanation:In this program, We are printing the values that are pointed by pointer and also the dereference oerator.
Output:
$ g++ def5.cpp
$ a.out
7
0xbf99fc98
8
5
14
The size of a datatype mainly depends on complier only.
Output:
$ g++ def3.cpp
$ a.out
4
Answer: (a)
Explanation:In this program, We are printing the values and memory address
by using the pointer and derefernce operator.
Output:
$ g++ def2.cpp
$ a.out
1
1
0xbffc9924
1
In this program, we are copying the memory location of x into p and then printing the value in
the address.
Output:
$ g++ def1.cpp
$ a.out
5
None.
In this program, We are making the assignments and invoking the both b and c values as 100
by dereference operator.
Output:
$ g++ def.cpp
$ a.out
100 100
None.
Derefencing is using a pointer with asterix. For example, *(abc).