Which of the following ways are legal to access a class data member using this pointer?
(A) this.x (B) *this.x
(C) *(this.x) (D) (*this).x
Ans:D
Which of the following declarations are illegal?
(A) void *ptr; (B) char *str = “hello”;
(C) char str = “hello”; (D) const *int p1;
Ans:C
What will be the result of the expression 13 & 25
(A) 38
(B) 25
(C) 9
(D) 12
Ans:C
Which of the following operator can be overloaded through friend function?
(A) ->
(B) =
(C) ( )
(D) *
Ans:D
To access the public function fbase() in the base class, a statement in a derived class function fder() uses the statement.fbase();
(A) fbase();
(B) fder();
(C) base::fbase();
(D) der::fder();
Ans:A
Maximum number of template arguments in a function template is
(A) one
(B) two
(C) three
(D) many
Ans:D
Which can be passed as an argument to a function?
(A) constant (B) expression
(C) another function (D) all of the above.
Ans:A
Member functions, when defined within the class specification:
(A) are always inline.
(B) are not inline.
(C) are inline by default, unless they are too big or too complicated.
(D) are not inline by default.
Ans:A
0 comments:
Post a Comment