For example we have priority_queue<int> s; which contains some elements. What will be correct form of the following code:
while (!s.empty()) {
int t=s.pop();// this does not retrieve the value from the queue
cout<<t<<endl;
}
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Refer to your documentation and you’ll see
pophas no return value. There are various reasons for this, but that’s another topic.The proper form is:
Or: