Call
whatsapp
9447387064 | 9847003556
0471-2335855 | 8089080088 | 0471-2334855
9447387064 | 9847003556
0471-2335855 | 8089080088 | 0471-2334855
Cisco Training in Trivandrum, Trinity Technologies

No.1 Training Institute in Kerala

C++ - QUESTIONS : PART 9

const member function does not allow to modify/alter value of any data member of the class.

True

 False
SHOW ANSWER

Scope resolution operator is used______ .

to resolve the scope of global variables only 

 to resolve the scope of functions of the classes only

 to resolve scope of global variables as well as functions of the classes

 None of these
SHOW ANSWER

In CPP program, Can we declare and define a user defined function inside a struct as we do in a class ?

Yes

 No

Can’t say
SHOW ANSWER

A function can be declared as friend maximum only in two classes.

True

 False
SHOW ANSWER

If a class contains static variable, then every object of the class has its copy of static variable.

True

False
SHOW ANSWER

Using friend operator function, following perfect set of operators may not be overloaded.

= , ( ) , [ ] , -> 

 <<, = = , [ ] , >>

 ?, = , ( ) , ++

 None of these
SHOW ANSWER

Classes in CPP are________ .

derived data types 

 User defined data types 

 built-in data types 

 All of these
SHOW ANSWER

Public data members and member functions of the class are accessible ONLY to the member functions of that class.

True

 False
SHOW ANSWER

We can initialize a value of static variable of a class only when its object is created. No other initialization is permitted.

True 

 False
SHOW ANSWER

What is the difference between protected and private access specifiers in inheritance?

private member is not inheritable and not accessible in derived class.

 protected member is inheritable and also accessible in derived class.

 Both are inheritable but private is accessible in the derived class.

Both are inheritable but protected is not accessible in the derived class.
SHOW ANSWER

A friend function does not have 'this' pointer associated with it.

True

 False
SHOW ANSWER

In CPP, it is mandatory and must to initialize const variables.

True

 False
SHOW ANSWER

A const object of a class can call non-const member function of the class.

 True

 False
SHOW ANSWER

If an argument to a function is declared as const, then _______ .

 function can modify the argument. 

 Function can’t modify the argument. 

 const argument to a function is not possible. 

 None of these
SHOW ANSWER

Can member functions of one class be friend functions of another class?

Yes

 No
SHOW ANSWER

Static variable must be declared in public section of the class.

True

 False
SHOW ANSWER

By default, if a function with minimum lines of code is declared and defined inside the class becomes Inline function.

True 

False
SHOW ANSWER

Static variable declared in a class are also called_________ .

instance variable 

 named constant 

 global variable 

class variable 
SHOW ANSWER
BACK | NEXT
TRINITY SOFTWARE SOLUTIONS,IInd floor, Radheyam Towers, Gandhari Amman Kovil Road, Pulimood, Trivandrum - 1
0471-2334855 | 2335855 | 9447387064 | 9847003556 info@trinitytechnology.in