Skip to content
This repository has been archived by the owner on Nov 8, 2023. It is now read-only.

Latest commit

History

History
19 lines (14 loc) 路 482 Bytes

back.md

File metadata and controls

19 lines (14 loc) 路 482 Bytes

back

Description : The list::back() function in C++ STL returns a direct reference to the last element in the list container.

Example:

    // Initialization of list 
    std::list<int> demo_list; 
  
    // Adding elements to the list 
    demo_list.push_back(10); 
    demo_list.push_back(20); 
    demo_list.push_back(30); 
  
    // prints the last element of demo_list 
    std::cout << demo_list.back(); 

Run Code