Jul 14, 2016 at 6:48am UTC
Hi I'm having a problem with an undeclared identifier error.
I can't seem to find out why
<
#pragma once
#include <iostream>
#include <vector>
#include <string>
#include "Edge.h"
using namespace std;
template <class type>
class Vertex
{
private:
string name;
type data;
public:
Vertex(string name, type data)
{
this->name = name;
this->data = data;
}
class Adj_List
{
public:
vector <Edge>edges;
};
};
>
and
<
#pragma once
#include <iostream>
#include <string>
#include "Vertex.h"
using namespace std;
template <class type>
class Edge
{
private:
double weight;
Vertex<type> * next_vertex;
public:
Edge(double weight, Vertex<type> next_vertex )
{
this->weight = weight;
this->next_vertex = &next_vertex;
}
Vertex<type>* getnext() { return next_vertex; }
};
>
Jul 14, 2016 at 6:48am UTC
The error is at vector <Edge> edges;