Thread: Linked LIst error

  1. #1
    Registered User
    Join Date
    Nov 2003
    Posts
    8

    Linked LIst error

    I'm currently working on a linked list program where I use nodes inside of a header file for another class. I'm using this syntax in the header file where the node is defined as a struct under the private section:

    Code:
    head->next=new Node;
    yet when I compile, it gives me errors that I don't have a constructor for the "StoreList::Node" class...how exactly do I get around this.... OR.....what is the syntax I need to define a simple one that does nothing (I dont need it to)...

    I'vs Tried doing the

    Code:
    StoreList::Node()
    {}
    and

    Code:
    StoreList::Node::Node()
    {}
    to no avail

    Appreciate any help,

    Arm

  2. #2
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,708
    Not sure why it's giving that specific error as it seems the real problem is that the nested 'Node' class is private...

    Your options in that case would either be to provide a member function (in the class that holds this private data) that will spit out a 'Node' or else simply make the''Node' class public.
    Code:
    #include <cmath>
    #include <complex>
    bool euler_flip(bool value)
    {
        return std::pow
        (
            std::complex<float>(std::exp(1.0)), 
            std::complex<float>(0, 1) 
            * std::complex<float>(std::atan(1.0)
            *(1 << (value + 2)))
        ).real() < 0;
    }

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. how do you resolve this error?
    By -EquinoX- in forum C Programming
    Replies: 32
    Last Post: 11-05-2008, 04:35 PM
  2. Errors including <windows.h>
    By jw232 in forum Windows Programming
    Replies: 4
    Last Post: 07-29-2008, 01:29 PM
  3. Quantum Random Bit Generator
    By shawnt in forum C++ Programming
    Replies: 62
    Last Post: 06-18-2008, 10:17 AM
  4. error: template with C linkage
    By michaels-r in forum C++ Programming
    Replies: 3
    Last Post: 05-17-2006, 08:11 AM
  5. load gif into program
    By willc0de4food in forum Windows Programming
    Replies: 14
    Last Post: 01-11-2006, 10:43 AM