using System;
using System.Linq;
using System.Text;
using System.Collections.Generic;
namespace QueueTest
{
class Program
{
static void Main(string[] args)
{
Queue<Info> Infos = new Queue<Info>();
Info i = new Info();
i.id = "id1";
i.name = "name1";
//入队
Infos.Enqueue(i);
Console.WriteLine(Infos.Count);
//出队
Info t = Infos.Dequeue();
Console.WriteLine(t.id + ":" + t.name);
Console.WriteLine(Infos.Count);
}
}
public struct Info
{
public string id;
public string name;
}
}
MSDN
C#队列
最新推荐文章于 2024-08-17 11:26:05 发布