所以基本上我有一个点结构
typedef struct point {
unsigned int x;
unsigned int y;
} Point;
现在我想为存储点做一个队列。
queue<Point> *pointsQueue = new queue<Point>; // shouldn't be changed
但是现在当我尝试将一个点推入队列时,会出现以下错误
error:request for member 'push' in 'pointQueue', which is of non-class type 'std::queue<Point>*'
基本上是在创建一个点 p
Point p;
p.x = 3;
p.y = 4;
然后我将它推入队列
pointQueue.push(p);
我有一个包含文件:
#include <queue>