#include<iostream>
using namespace std;
const int M = 100;
template<class T>
struct ArcNode
{
int adjvex;
ArcNode<T>* next;
};
template<class T>
struct VertexNode
{
T vertex;
ArcNode<T>* firstedge;
};
template<class T>
class ListGraph
{
public:
ListGraph(T a[],int v,int e);
~ListGraph();
void DFST();
private:
VertexNode<T> vex[10];
int vNum, aNum;
};
template<class T>
inline ListGraph<T>::ListGraph(T a[], int v, int e)
{
int i = 0;
vNum = v; aNum = e;
for (i = 0; i < v; i++)
{
vex[i]->vertex = a[i];//这一步时vs2019提示vex[i].(没有可用成员)
vex[i]->firstedge = NULL;
}
}
我该怎么对这个结构体数组中每一个结构体的成员赋值呢?