Thu Nov 13, 2008 7:52 pm
#include <iostream>
using std::cout;
using std::endl;
#include <queue>
int main()
{
std::priority_queue< double > priorities;
priorities.push( 3.2 );
priorities.push( 9.8 );
priorities.push( 5.4 );
cout << "Popping from priorities: ";
while ( !priorities.empty() )
{
cout << priorities.top() << ' ';
priorities.pop();
}
cout << endl;
return 0;
}
/*
Popping from priorities: 9.8 5.4 3.2
*/
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com
Powered by phpBB © phpBB Group.