【发布时间】:2011-01-12 10:55:58
【问题描述】:
我知道我可能在这里做了一些不可原谅的愚蠢的事情,但由于某种原因我的代码无法编译,我不知道为什么。
#include <iostream>
#include <list>
//A queue for the working set
//x,y co-ords of the square, path length so far
struct square {
int x;
int y;
int path_length;
} square;
list<square> workingset;
我还有其他代码似乎以完全相同的方式创建列表 -
#include <iostream>
#include <list> //List class library
#include <algorithm> //STL algorithms class library (find)
using namespace std;
list<int> numberlist; //Creates my list
问题似乎不是因为结构,因为我也尝试过制作整数列表,但它也不起作用。
我遇到的错误是 -
语法错误:缺少';'在 '
(都在我试图声明列表的那一行)
那么我在这里错过了什么非常愚蠢的事情? :3
【问题讨论】:
-
使用 std::list 声明一个列表。
-
谁能帮帮我? [从C++结构的STL列表中修改属性元素][1][1]:stackoverflow.com/a/30798787/4959934