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

Latest commit

 

History

History
20 lines (14 loc) · 579 Bytes

cbegin.md

File metadata and controls

20 lines (14 loc) · 579 Bytes

cbegin

Description :he list::cbegin() is a built-in function in C++ STL which returns a constant random access iterator which points to the beginning of the list.

Example:

    // declaration of list 
    std::list<int> lis = { 15, 26, 37, 48, 59 }; 
  
    // Prints the first element 
    std::cout << "The first element is: " << *lis.cbegin(); 
  
    // printing list elements 
    std::cout << "\nList: "; 
  
    for (auto it = lis.cbegin(); it != lis.end(); ++it) 
        std::cout << *it << " "; 
 

Run Code