CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2004
    Posts
    41

    deleting apart of a linked list

    I have the same problem i am trying to delete a part of a linked list I have the code

    Code:
    void deleteitem(struct list *fly)
    {
    	int deletenumber;
    	int count=0;
    
    	scanf("%i", &deletenumber);
    	
    	goto_head(fly);
    
    	for(count = 0 ; count == deletenumber ; count ++)
            {
    			goto_next(fly);
    			
    	}
    
    			delete(fly);
    				
    		
    }
    and I don't know how to delete an item out of the linked list at the location deletenumber, this code keeps taking the first part out can some one tell me what i need to fix it.

  2. #2
    Join Date
    Oct 2004
    Posts
    3

    Re: deleting apart of a linked list

    Quote Originally Posted by Robbo99

    void deleteitem(struct list *fly)
    {
    ...
    for(count = 0 ; count == deletenumber ; count ++)
    May be count!=deletenumber ?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured