Classical

Object Oriented Programming - Basics of C++

11:  

Consider the declarations
char a;
const char aa = 'h';
char *na;
const char *naa;

                       Which of the following statements
Statement I: aa = a;
Statement II: na = &a;
Statement III: na = &aa;
                                  is/are illegal?     

A.

Only I and II

B.

Only II and III

C.

Only I and III

D.

All the three statements are illegal

 
 

Option: C

Explanation :


12:  

Forgetting to include a file (like cmath or math.h) that is necessary will result in

A.

compilation error

B.

warning when the program is run

C.

error at link time

D.

warning when the program is compiled

 
 

Option: C

Explanation :


13:  

Which of the following comments about inline comments are true?   

A.

A function is declared inline by typing the keyword inline before the return value of the function.

B.

A function is declared inline by typing the keyword inline after the return value of the function.

C.

A function that is declared inline may not be treated inline.

D.

Both (a) & (c)

 
 

Option: D

Explanation :


14:  

At what point of time a variable comes into existence in memory is determined by its  

A.

scope

B.

storage class

C.

data type

D.

all of the above

 
 

Option: B

Explanation :


15:  

Which of the following specifiers need not be honored by the compiler?  

A.

register

B.

inline

C.

static

D.

Both (a) & (b)

 
 

Option: D

Explanation :

Register and inline are not compiler directives but rather request to the compiler. These requests need not be honored by the compiler.




Suggest an improvement