The forward_list::cbegin() is a function in C++ STL which returns a constant iterator pointing to the first element of the forward_list.
Parameters: This function does not accept any parameter.
Return Value: This function returns an iterator that points to the const content. Since the iterator is not constant it can be increased or decreased or modified but as it cannot be used to modify its content even if the forward list is not constant. If the forward list is empty, the iterator returned by the function will not be dereferenced.
The following programs illustrate the use of the function:
1st element of sample: 45
sample: 7 4 9 15
Rated as one of the most sought after skills in the industry, own the basics of coding with our C++ STL Course and master the very concepts by intense problem-solving.