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 (15 loc) · 472 Bytes

assign.md

File metadata and controls

20 lines (15 loc) · 472 Bytes

assign

Description :The list::assign() is a built-in function in C++ STL which is used to assign values to a list.

Example:

    // Initialization of list 
    std::list<int> demo_list; 
  
    // Assigning the value 100, 5 times 
    // to the list, list_demo. 
    demo_list.assign(5, 100); 
  
    // Displaying the list 
    for (int itr : demo_list) { 
        std::cout << itr << " "; 
    } 

Run Code