Looking for a help

Discussion in 'C' started by ihatec, Sep 1, 2010.

  1. ihatec

    ihatec New Member

    Joined:
    Sep 1, 2010
    Messages:
    20
    Likes Received:
    3
    Trophy Points:
    0
    Hi,
    I am new here and I need help, because I have some troubles with C programming language, especially with data structure called linked list.
    I know I use structure like this e.g.
    struct list
    {
    char *name;
    char *surname;
    short age;
    struct list *next;
    };
    and in main function I allocate memory for head pointer and pass to functions.
    But for example I want to have name and surname also dynamically alocated and I don't know where to do this. I have seen some functions where list was passed as pointer to pointer (struct list **head) and I want to know when to do this. Is there maybe some good tutorial or a book where I can find the explanation to this problems.
     
  2. virxen

    virxen Active Member

    Joined:
    Nov 24, 2009
    Messages:
    387
    Likes Received:
    90
    Trophy Points:
    28

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice