Skip to content

Latest commit

 

History

History
26 lines (19 loc) · 487 Bytes

cbegin.md

File metadata and controls

26 lines (19 loc) · 487 Bytes

cbegin

Description : This method is used to return a const_iterator pointing to the first element in the container.

Example :

//Run Code To Demonstrate use of set.cbegin()
#include <iostream>
#include <set>

int main ()
{
std::set<int> myset = {50,20,60,10,25};

std::cout << "myset contains:";
for (auto it=myset.cbegin(); it != myset.cend(); ++it)
    std::cout << ' ' << *it;

std::cout << '\n';

return 0;
}

Run Code