Functions declared with the _______________ specifier
in a class member list are called friend functions of that class.
protected
private
public
friend
protected
private
public
friend
Functions declared with the friend specifier in
a class member list are called friend functions of that class.
Classes declared with the friend specifier in the member list of
another class are called friend classes of that class.
Public or private keywords can be ____________
written only for once in the class or structure declaration
written multiple times in the class or structure declaration
written only twice in the class declaration
written outside the class
written only for once in the class or structure declaration
written multiple times in the class or structure declaration
written only twice in the class declaration
written outside the class
good practice is to write public or private keywords
only once in the class or structure declaration, though there is no syntactical
or logical problem in writing them multiple times.
The friend keyword provides access _____________.
in one direction only
in two directions
to all classes
to the data members of the friend class only
in one direction only
in two directions
to all classes
to the data members of the friend class only
The friend keyword provides access in one
direction only. This means that while OtherClass is a friend of ClassOne,
the reverse is not true.
References cannot be uninitialized. Because it is impossible to _______________
References cannot be uninitialized. Because it is impossible to _______________
reinitialize a pointer
reinitialize a reference
initialize a NULL pointer
cast a pointer
References cannot be uninitialized. Because it is impossible to reinitialize a reference,
reinitialize a reference
initialize a NULL pointer
cast a pointer
References cannot be uninitialized. Because it is impossible to reinitialize a reference,
new operator can be used for ______________.
only integer data type
only char and integer data types
integer , float, char and double data types
dot operator
Similarly, new operator can be used for other data types like char, float and double etc.
only integer data type
only char and integer data types
integer , float, char and double data types
dot operator
Similarly, new operator can be used for other data types like char, float and double etc.
The destructor is used to ______________.
allocate memory
deallocate memory
create objects
allocate static memory
deallocate memory
create objects
allocate static memory
Reference is not really an address it is ______________.
a
synonym
an antonym
a value
a number
Difference Between References and Pointers
The reference in a way keeps the address of the data entity. But it is not really an address it is a synonym,
an antonym
a value
a number
Difference Between References and Pointers
The reference in a way keeps the address of the data entity. But it is not really an address it is a synonym,
If we want to allocate memory to an array of 5 integers
dynamically, the syntax will be _____________.
int
*iptr ; iptr = new int[5] ;
integer iptr** ; iptr= new int[5]
int iptr ; iptr= int [5]
iptr= new[5]
Memory allocated from heap or free store
_____________________.
can be returned back to the system automatically
can be allocated to classes only
cannot be returned back unless freed explicitly using
malloc and realloc
cannot
be returned back unless freed explicitly using free and delete operators
The memory allocated from free store or heap is
a system resource and is not returned back to the system unless explicitly
freed using deleteor free operators.
Operator overloading is to allow the same operator to be
bound to more than one implementation, depending on the types of the _________.
Compilers
Operands
Function names
Applications
Operands
Function names
Applications
Operator overloading is to allow the same operator to be
bound to more than one implementation, depending on the types of the
operands.
The operator to free the allocated memory using new
operator is ________________.
free
del
delete
remove
del
delete
remove
The operator to free the allocated memory using new
operator is delete. So whenever, we use new to allocate memory, it will be
necessary to make use of ‘delete’ to deallocate the allocated memor
Comments
Post a Comment
Please give us your feedback & help us to improve this site.