Please Help Linked list problems!

Discussion in 'C Programming' started by RBCC, Jan 20, 2011.

  1. RBCC

    RBCC Guest

    Please Help!

    I am using this structure :

    typedef struct Sname
    {
    char *pSzfirst;
    char *pSzLast;
    struct name *Snext;
    }

    person* FindMin (person *pSHead)
    {
    person *pSMin;
    person *pSCurr;

    pSMin=pSHead;
    pSCurr=pSHead;

    while (pScurr!= NULL)
    {
    if (strcmp(pScurr->pszfirst,pSMin->pszfirst)<0)
    {
    pSMin=pSCurr;

    }

    pSCurr=pScurr->Snext;
    }

    return psMin;
    } //Error:Expected a declaration! What can I do to make this work?

    Could somebody please write a piece of code that will walk the list?
    Thank you, John
     
    RBCC, Jan 20, 2011
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Andrej Hocevar
    Replies:
    1
    Views:
    483
    Nick Austin
    Aug 18, 2003
  2. fool
    Replies:
    14
    Views:
    518
    Barry Schwarz
    Jul 3, 2006
  3. Replies:
    6
    Views:
    325
    Amedeo Verita
    Dec 7, 2005
  4. joshd
    Replies:
    12
    Views:
    678
    John Carson
    Oct 2, 2006
  5. RBCC

    Please Help Linked list problems!

    RBCC, Jan 20, 2011, in forum: C Programming
    Replies:
    3
    Views:
    333
    Eric Sosman
    Jan 24, 2011
Loading...

Share This Page