为了让这也是加权重图,我以后的事数据结构,重图
#include <iostream>
#include <vector>
using namespace std;
struct maps
{
vector<char> weight(10); //to store weight of self-loops and multi-edges
};
int main()
{
maps m1[101][101], m2[101][101];
return 0;
}
,但我得到以下错误:
error: expected identifier before numeric constant
error: expected ‘,’ or ‘...’ before numeric constant
我该如何解决这个问题?
'vector weight;'。不要在'struct'定义中启动成员。它们应该在构造函数中或之后启动。 –
2012-02-26 11:12:38
@AdeYU:我不明白 – 2012-02-26 11:25:28