This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

compiler error 42


is produced by 
g++ LinkedList.cc
on an i686 Linux RH 5.2
#include "LinkedList.hh"
#include "LinkedNode.hh"

void LinkedList::addElem(int pos, LinkedNode & node)
{
  LinkedNode * newcopy = new LinkedNode(node);

  if( !nelems ) //if empty list
    {
      head = newcopy;
      nelems = 1;
      return;
   }
 
}
      



#include "LinkedNode.hh"
#define NULL '\0'

class LinkedList {
public:

  int nelems;

  LinkedNode * head;
  
  LinkedList()
    {
      int nelems = 0;
      head = NULL;
    }

  LinkedList( LinkedList & other) //copy constructor
    {
      nelems = other.nelems;
      head = other.head;
    }

  void addElem();
};
      






template<class T> class LinkedNode {
public:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]