Skip to content

Latest commit

 

History

History
18 lines (13 loc) · 592 Bytes

crbegin.md

File metadata and controls

18 lines (13 loc) · 592 Bytes

crbegin

Description : The list::crbegin() is a built-in function in c++ STL that returns a constant reverse iterator which points to the last element of the list i.e reversed beginning of container.

Example:

    // declaration of the list 
    std::list<int> lis = { 109, 207, 305, 403, 501 }; 
  
    // prints the last element 
    std::cout << "The last element is: " << *lis.crbegin(); 
    std::cout << "\nList: "; 
  
    for (auto it = lis.crbegin(); it != lis.crend(); ++it) 
        std::cout << *it << " "; 

Run Code