Thread: Pointers Linked List

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,057
    The example doesn't actually create a linked list at all. It makes a single EnemySpaceShip, then calls updateShip on that single ship. The structure does have a next pointer which is set to NULL, but that in itself doesn't make it a linked list. The updateShip() function isn't going to magically follow the list and apply to other elements in the linked list. So if you're trying to make a remove() function, maybe you should first create an insert() function?... What exactly is your question?
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

  2. #2
    Registered User
    Join Date
    Feb 2013
    Location
    Sweden
    Posts
    171
    I have seen the code example and I know that it isn't creating a linked list. But I have no idea of how to write a program that removes a element from a linked list. Is it any website or something exaplaining linked list. Or hints that somebody can give to help me? It is one of the practice problems in Jumping Into C++ and I want to do all of them so you really can understand how pointers work

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. problem with pointers in linked list
    By django in forum C Programming
    Replies: 36
    Last Post: 07-29-2011, 10:02 AM
  2. Help a Student in C (Linked List, Pointers etc)
    By mocha1218 in forum C Programming
    Replies: 14
    Last Post: 07-02-2010, 01:38 PM
  3. Linked List with Two Pointers
    By aspekt9 in forum C Programming
    Replies: 5
    Last Post: 12-07-2009, 04:23 PM
  4. linked list and pointers : ??????
    By gemini_shooter in forum C Programming
    Replies: 7
    Last Post: 05-04-2005, 05:02 AM
  5. Linked List and Array of Pointers
    By Nish in forum C Programming
    Replies: 4
    Last Post: 03-04-2005, 04:28 PM