假设我有一个整数队列,
#include <iostream>
#include <queue>
using namespace std;
int main() {
int firstValToBePushed = 1;
queue<int> CheckoutLine;
CheckoutLine.push(firstValeToBePushed);
cout << CheckoutLine.front();
return 0;
}
Run Code Online (Sandbox Code Playgroud)
我怎样才能使用保存指向整数的指针而不是像上面当前那样的整数来完成基本上相同的事情。我计划创建一个循环来生成多个值,但这只是一个更简单的示例。
谢谢,