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.
- vector :: cbegin() and vector :: cend() in C++ STL
- list cbegin() and cend() function in C++ STL
- array::cbegin() and array::cend() in C++ STL
- multimap::cbegin() and multimap::cend() in C++ STL
- map cbegin() and cend() function in C++ STL
- unordered_set cbegin() function in C++ STL
- unordered_multiset cbegin() function in C++ STL
- unordered_multimap cbegin() function in C++ STL
- match_results cbegin() add cend() in C++ STL
- deque cbegin() in C++ STL
- unordered_map cbegin in C++ STL
- multiset cbegin() and cend() function in C++ STL
- set cbegin() and cend() function in C++ STL
- Kruskal's Minimum Spanning Tree using STL in C++
- Dijkstra’s shortest path algorithm using set in STL
- Dijkstra's Shortest Path Algorithm using priority_queue of STL
- Prim's algorithm using priority_queue in STL
- unordered_map in C++ STL
- fill() and fill_n() functions in C++ STL
- std::transform() in C++ STL (Perform an operation on all elements)
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.