basic linked list declaration..need explanation

This is a discussion on basic linked list declaration..need explanation within the C Programming forums, part of the General Programming Boards category; hey guys, Can someone please explain what this does? typedef struct nodetag { DATA directory; struct nodetage *next; } NODE; ...

  1. #1
    Registered User
    Join Date
    Apr 2002
    Posts
    63

    Question basic linked list declaration..need explanation

    hey guys,
    Can someone please explain what this does?

    typedef struct nodetag
    {
    DATA directory;
    struct nodetage *next;
    } NODE;

    How does the 'next' bit point to the next item in the list? It would be helpful is someone provided a thorough explanation of the code. Thanks
    A

  2. #2
    Im back! shaik786's Avatar
    Join Date
    Jun 2002
    Location
    Bangalore, India
    Posts
    345

  3. #3
    Unregistered
    Guest
    *next is a pointer to struct nodetag. It is how you get from one node to the next node. Ask more questions.

  4. #4
    Registered User
    Join Date
    Apr 2002
    Posts
    63
    I know what next does..I even know that it is a pointer to struct nodetag..I don't get as to how does it work? What is the logic behind how it works? In fact, what is nodetag??
    There we go..I've asked more questions..
    A

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Need help sorting a linked list. Beginner
    By scarlet00014 in forum C Programming
    Replies: 1
    Last Post: 09-27-2008, 07:16 PM
  2. help! Placement of nodes in a Linked List
    By lostmyshadow in forum C Programming
    Replies: 6
    Last Post: 12-17-2007, 01:21 PM
  3. Please Help - Problem with Compilers
    By toonlover in forum C++ Programming
    Replies: 5
    Last Post: 07-23-2005, 11:03 AM
  4. Linked List
    By jpipitone in forum C Programming
    Replies: 4
    Last Post: 03-30-2003, 09:27 PM
  5. 1st Class LIST ADT
    By Unregistered in forum C++ Programming
    Replies: 1
    Last Post: 11-09-2001, 07:29 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21