I am writing a program to compute the fastest/shortest path between locations (stored in a directed graph represented by an adjacency list). I am trying to create this adjacency list ("al") as an array of pointers to Vertex class objects, but I get the error " 'al' was not declared in this scope". Any suggestions on where I should create the adjacency list to avoid scope problems would be greatly appreciated.
Description of the files:
- main.cpp - Reads in input files
- vertex.cpp and vertex.h - Define the Vertex class
- segment.cpp and segment.h - Define the Segment class
- locations.txt - Input file containing the number and names of locations, each of which should be a vertex
- segments.txt - Input file containing information about the segments connecting the vertices. Each line has four values: vertex number where segment begins, vertex number where segment ends, distance of segment, traffic speed on segment
- trips.txt - Trip requests
The text files must be input to the program in this order: locations.txt segments.txt trips.txt