Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

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 << " ";
 
PREVIOUS NEXT
Tagged: #print #list
ADD COMMENT
Topic
Name
4+1 =