As I look at this more, I'm pretty sure my problem is in network.h or network.cpp. Here is my code for those
Code:
// network.h
// declaration file for network class
#include "stdinc.h"
//#include "network.cpp"
using namespace std;
const int MAX_NODES=100;
class network
{
public:
network(); // default constructor
void insertedge(int first, int second); // insert function to add an edge between 2 nodes
void deleteedge(int first, int second); // delete edge from 2 nodes, may not need this
void clearnetwork(); // set adj matrix, N, and M to all 0's
void read_network(char* file_name);// read a network in from a file
void print_network(); // prints the graph
void numbers(int& n, int& m); //return the numbre of edges
protected:
int N; // num of nodes in graph
int M; // num of edges in graph
int adj[MAX_NODES][MAX_NODES]; // adjacency matrix
}
Code:
#include"network.h"
#include"stdinc.h"
using namespace std;
network::network()// default constructor
{
N=0;
M=0;
}
void network::insertedge(int first, int second) // insert function to add an edge between 2 nodes
{
}
void network::deleteedge(int first, int second) // delete edge from 2 nodes, may not need this
{
}
void network::clearnetwork() // set adj matrix, N, and M to all 0's
{
for(int i=0;i<MAX_NODES;i++)
{
for(int j=0;j<MAX_NODES;j++)
{
adj[i][j]=0;
}
}
N=0;
M=0;
}
void network::read_network(char* file_name)// read a network in from a file
{
}
void network::print_network() // prints the graph
{
}
void network::numbers(int& n, int& m) //return the numbre of edges
{
}