queue
来源:互联网 发布:旧电脑数据导入新电脑 编辑:程序博客网 时间:2024/05/17 23:55
// queue.cpp : 定义控制台应用程序的入口点。
//queun 队列 FIFO 形式(先进先出)
//利用queue可以用来模拟实现枪战类游戏的子弹射击效果,在一个线程中检验队列是否为空,如果不为空,就将头部子弹出列,如果为空,什么也不做,用户点击开枪键就是在尾部将新子弹入队的过程
//VS2010上编译通过
#include "stdafx.h"
#include <string>
#include <queue>
#include <iostream>
#include <stdlib.h>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
queue<string> queueStr;
queueStr.push("张三");
queueStr.push("李四");
queueStr.push("王五");
cout<<"current queue size:"<<queueStr.size()<<endl<<endl;
while (!queueStr.empty())
{
cout<<queueStr.front()<<endl;
queueStr.pop();
}
cout<<"current queue size:"<<queueStr.size()<<endl<<endl;
system("pause");
return 0;
}
- Queue
- queue
- Queue
- QUEUE ~
- queue
- queue
- queue
- queue
- queue
- queue
- Queue
- Queue
- queue
- queue
- Queue
- Queue
- queue
- Queue
- windows OpenCV 2.3.1 Python 2.7(2.75)配置
- STL迭代器简介
- MFC子父窗口发送消息
- Python的对象和类型
- learning puppet 3— Classes and Modules
- queue
- Android相机开发(一)之预览拍照查看图片基本功能的实现
- Matlab 安装libsvm-3.1工具箱介绍
- 【Deep Learning学习笔记】Modeling Documents with a Deep Boltzmann Machine_Hinton_uai2013
- css优化技巧
- MatPlotLib(Basemap)与Grads、NCL和GMT的对比
- 用代码创建UITabBarController
- Thinking in Java(第四版)习题--第三章
- hdu 2896 病毒侵袭 AC自动机