Answers for "how to print list in c++"

C++
2

how to print list in c++

#include <iostream>
#include <list>

std::list<int> listOfNumbers = {1, 2, 3, 4};

for (int item : listOfNumbers)
  std::cout << item << " ";
Posted by: Guest on November-02-2020

Browse Popular Code Answers by Language