int main(){ // 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 << " "; } return 0; }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter