Link List

This is a discussion on Link List within the C Programming forums, part of the General Programming Boards category; Does anyone know of any examples of global link list?...

  1. #1
    Registered User
    Join Date
    Jul 2005
    Posts
    56

    Link List

    Does anyone know of any examples of global link list?

  2. #2
    Gawking at stupidity
    Join Date
    Jul 2004
    Location
    Oregon, USA
    Posts
    3,159
    If you understand what you're doing, you're not learning anything.

  3. #3
    Registered User
    Join Date
    Oct 2001
    Posts
    2,934
    I don't know what you mean by global, but there's a linked list tutorial here at Cprogramming.


  4. #4
    Registered User
    Join Date
    Jul 2005
    Location
    Transcarpathia
    Posts
    49
    actually, that tutorial is not fully correct. For example, this
    Code:
    struct node {
      int x;
      node *next;
    };

  5. #5
    ---
    Join Date
    May 2004
    Posts
    1,379
    what is incorrect about that? Looks like valid C++ to me

  6. #6
    pdc
    pdc is offline
    Registered User
    Join Date
    Jun 2005
    Posts
    28
    It should be:
    Code:
    struct node {
      int x;
      struct node *next;
    };
    The original version could be made valid with an appropriate typedef.

  7. #7
    Registered User
    Join Date
    Oct 2001
    Posts
    2,934
    Oops, sorry, it is C++. As shown by pdc, change the struct definition, and the print line:
    Code:
        cout<< conductor->x;
    To:
    Code:
        printf( "%d ", conductor->x );
    and you've got the C version. I guess that's assuming your compiler will compile the // comments.

  8. #8
    Registered User cbastard's Avatar
    Join Date
    Jul 2005
    Location
    India
    Posts
    167
    have'nt heard the word global link list.do tell me if it is diff than link list.
    in between wat r u trying to do swoopy.he dont know link list and u r telling him how to access members

  9. #9
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    Do you have to try to be this stupid, or does it just come natural? He was shown an example of how to search for linked lists. He was shown an example of how to set up a node for a linked list. Why is it then, he shouldn't be shown how to access members of said node?

    You should change your name to "I'm a ........ing idiot."


    Quzah.
    Hope is the first step on the road to disappointment.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Unknown memory leak with linked lists...
    By RaDeuX in forum C Programming
    Replies: 6
    Last Post: 12-07-2008, 03:09 AM
  2. Link List Insert prob
    By Bebs in forum C Programming
    Replies: 8
    Last Post: 12-03-2008, 09:28 PM
  3. reading data from a file - link list
    By peter_hii in forum C++ Programming
    Replies: 7
    Last Post: 10-25-2006, 09:11 AM
  4. compiler build error
    By KristTlove in forum C++ Programming
    Replies: 2
    Last Post: 11-30-2003, 09:16 AM
  5. singly linked list
    By clarinetster in forum C Programming
    Replies: 2
    Last Post: 08-26-2001, 10:21 PM

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