The input is in the following format

```
5
1 2  9.0
1 3 12.0
2 4 18.0
2 3  6.0
2 5 20.0
3 5 15.0
0
1 5

```

The first number is the number of vertexes in the graph. Then next lines up to 0 are the edges of the graph. With the first and second numbers being the vertexes and the third being how far the edge is between them. Trying to read in the data and store the edges into there locations in the List adjacency for that vertex. This example would make a graph with five vertexes with edges from 1 to 2&3. 2 to 4&3&1 etc. I do not know if the format for storing into the list in my `readIn` function is correct (`myGraph.vertexInfo[p1].adjacency -> vertex=p2;`) .

Is `myGraph.vertexInfo[p1].adjacency -> vertex=p2;` the correct way to store it? Ff not how I would store the info into the adjacency lists for each vertex? Also I am getting a Segmentation fault after entering four numbers. 

```
#include <cstdio>
using namespace std;

struct ListCell
{
   ListCell* next;
   int vertex;
   double weight;

   ListCell(int v, double w, ListCell* nxt)
   {
      vertex = v;
      weight = w;
      next = nxt;
   }
};

typedef ListCell* List;

struct Vertex
{
   bool signaled;
   long distance;
   List adjacency;    
};

struct Graph
{
   int     numVertices;
   Vertex* vertexInfo;

   Graph(int n)
   {
      numVertices = n;
      vertexInfo  = new Vertex[n+1];
      for(int i = 1; i <= n; i++)
      {
         vertexInfo[i].signaled = false;
      }
   }
};

//==============================================================
//                   readIn
//==============================================================
// 
//==============================================================

void readIn()
{
   int g;
   int p1;
   int p2;
   float edge;
   scanf("%i ", &g);

   Graph myGraph(g);
   scanf("%i", &p1);
   while(p1 != 0)
   {
      scanf("%i", &p2);
      scanf("%f", &edge);         
      myGraph.vertexInfo[p1].adjacency -> vertex=p2; 
      myGraph.vertexInfo[p2].adjacency -> vertex=p1;
      myGraph.vertexInfo[p1].adjacency -> weight=edge; 
      myGraph.vertexInfo[p2].adjacency -> weight=edge;
      scanf("%i", &p1);
   }
}
//==============================================================
//                   main
//==============================================================

int main(int argc, char** argv)
{
   readIn();
   return 0;
}

```