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 283 views
283 views asked Jan 5, 2018 by avibootz
1 answer 297 views
1 answer 252 views
1 answer 266 views
1 answer 289 views
...