To make multigraphs which is weighted also , i do following thing
#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;
}
but I get following errors:
error: expected identifier before numeric constant
error: expected ‘,’ or ‘...’ before numeric constant
How can I fix this?
As Ade YU mentioned, do not define the size of your weight vector in it’s declaration. Instead, do it in the initializer list in the constructor. This should do what you’re looking for: