+1  A: 
head = tail = new Link();

Here you assign head and tail to point to the same link object. Since you never reassign either of them, that means that any time you change any property of head (e.g. head.next = foo), the same change is applied to tail.

Meaning head and tail will always have the same element, the predecessor and the same successor. Obviously this does not lead to the intended results.

sepp2k
+2  A: 

The statement:

 John();

Just constructs a new nameless John which is created and immediately destroyed. There is no way (in the current version of C++) to call a constructor from another constructor or on an already constructed object.

This means that the plots member of your John called k is never being initalized, hence the crash when you call append from the John constructor.

[As Neil Butterworth comments, if you had actually constructed an ll instance there are other issues with it, this is just the most immediate problem.]

Charles Bailey
ah, Thanks! You seem to have hit the nail spot on. Fixing that, it compiles and runs beautifully.
Born2Smile
A: 
  Plot p;
  John k(&p);

Use this instead:

  Plot * p = (Plot*) new Plot;
  John k(p);

This code is broken, since once p goes out of scope, k's reference to it will die. This is not the bug that caused the segfault, but it will probably cause a segfault later on once you fix your other bugs.

You will need to delete p later.

Brian
+2  A: 

Because you can't call alternate constructors like that in C++. In...

John(Plot* plot){
  John();
  plots->append(plot);
}

Your first line constructs a new John object using the default constructor, then throws the result away. It then calls append on plots (which as it has not been set to anything, is junk). Refactor the real plots initialisation code into a private method, then call this init method in both constructors before doing anything else.

Adam Wright