作者热门文章
- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
我需要执行一个for循环直到队列为空我的代码
queue<string> q;
for(int i=0;i<q.size(),i++)
{
// some operation goes here
// some datas are added to queue
}
最佳答案
while (!q.empty())
{
std::string str = q.front();
// TODO: do something with str.
q.pop();
}
关于c++ - 如何在C++中执行for循环直到队列为空,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3879055/
我是一名优秀的程序员,十分优秀!