Google News
logo
CPP - Quiz(MCQ)
What is the use of empty() function in array classes?
A)
To check whether an array is empty or not
B)
To check whether the size of an array is zero or not
C)
To check how many elements are there in the array
D)
To check whether an array contains negative elements or not

Correct Answer :   To check whether the size of an array is zero or not


Explanation : empty() function is used to check whether the size of an array class is zero or not. It is not used to check whether an array is empty or not. The function true only if size/max_size of an array is zero otherwise it returns false.

Advertisement