How to create an empty list of ints in C++

1 Answer

0 votes
#include <iostream>
#include <list>

int main()
{
	std::list<int> lst;                          

	for (auto elem : lst) {
		std::cout << elem << ' ';
	}
	std::cout << std::endl;
	
	return 0;
}

/*
run:



*/

 



answered Dec 30, 2017 by avibootz

Related questions

1 answer 188 views
188 views asked Jan 5, 2018 by avibootz
1 answer 192 views
1 answer 162 views
1 answer 169 views
1 answer 187 views
...