View Single Post
Join Date: Aug 2005
Posts: 15,472
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1477
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Still Learning

Re: C++ Segement Fault on Unix

 
0
  #2
Dec 2nd, 2008
My guess is that in main.cpp, the Graph object has not been initiaized, so when ReadGraph() is called and attempts to delete arrayEdges, CRASH/COREDUMP.

In main() initialize all Graph variables to 0 before calling ReadGraph() to see if that resolves your problem.
  1. int main()
  2. {
  3. Graph g;
  4. memset(&g, 0, sizeof(Graph));
  5. readGraph(g);
  6. <snip>
Last edited by Ancient Dragon; Dec 2nd, 2008 at 10:33 pm.
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
Reply With Quote