C++ List empty()C++ List empty() function checks whether the list is empty or not. It returns true, if the list is empty otherwise false. It does not modify the content of the list. SyntaxParameterIt does not contain any parameter. Return valueIt returns boolean value either 1 or 0. If the list is empty, it returns 1 otherwise 0. Example 1Let's see a simple example when the list is empty. Output: empty() : 1 In this example, empty() function returns the value 1 as the list 'li' is empty. Example 2Let's see a simple example when the list is not empty. Output: empty() : 0 In this example, the empty() function returns the value '0' as the list is not empty.
Next Topicsize() Function
|