Thread: Linked List Help

  1. #1
    Registered User
    Join Date
    Oct 2006

    Linked List Help

    I've been trying to get down the concept of searching a linked list for given information. I'm looking to input a last name and first name and it somehow search the current listed items for that information. If it is there, it prints out the information in the array (Name and Phone No). If it isn't, it just says it isn't. I just..can't seem to get this right. Any suggestions or help would be appreciated. And I know I'm probably way off on it. I mean, I can get it to search with a single array set, but not with how it is now. Linked lists just hate me.

  2. #2
    Hurry Slowly vart's Avatar
    Join Date
    Oct 2006
    Rishon LeZion, Israel
    void search(TeleType *contents)
              while (s1 != name)
                        cout << s1;
              cout << endl;

    What is s1 here?
    What is name?
    How it is connected to contents?
    Where do you make list iteration?
    How many times you want to print a name?
    If you want to check 2 conditions - you do it as ( A && B )
    All problems in computer science can be solved by another level of indirection,
    except for the problem of too many layers of indirection.
    – David J. Wheeler

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. C++ Linked list program need help !!!
    By dcoll025 in forum C++ Programming
    Replies: 1
    Last Post: 04-20-2009, 10:03 AM
  2. Following CTools
    By EstateMatt in forum C Programming
    Replies: 5
    Last Post: 06-26-2008, 10:10 AM
  3. Reverse function for linked list
    By Brigs76 in forum C++ Programming
    Replies: 1
    Last Post: 10-25-2006, 10:01 AM
  4. Template Class for Linked List
    By pecymanski in forum C++ Programming
    Replies: 2
    Last Post: 12-04-2001, 09:07 PM
  5. singly linked list
    By clarinetster in forum C Programming
    Replies: 2
    Last Post: 08-26-2001, 10:21 PM