xFactorSchool.com(Beta)
How to Do Examples
Python Examples
HTML Examples
Code Examples
C Code Examples
C++ Code Examples
C# Code Examples
Java Code Examples
Python Code Examples
HTML Code Examples
CSS Code Examples
JavaScript Code Examples
Online Editor
C Code Editor
C++ Code Editor
C# Code Editor
Java Code Editor
Python Code Editor
HTML Code Editor
CSS Code Editor
JavaScript Code Editor
Practice how to create a list in C++
C++ Online Editor
Execute Code
More C++ Sample Code
#include <iostream> #include <list> // for list using namespace std; // use std namespace to avoid std:: before cout int main() { // Creating a list of string list<string> fruits; // Adding elements to the list fruits.push_back("Apple"); fruits.push_back("Banana"); fruits.push_back("Orange"); // Iterating through the list for (const auto& element : fruits) { cout << element << endl; } return 0; }