Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#
I have two classes:
 
SLList for methods (private SLElement _root)
 
SLElement for creating new elements for the list. (public int _value; public SLElement _next)
 
I have finished the add-method:
public void Add(int value)
{
  SLElement addNewElement = new SLElement();
  addNewElement._value = value;
  SLElement rootCopy = _root;
  _root = addNewElement;
  addNewElement._next = rootCopy;
  Console.WriteLine(addNewElement._value);
}
So now I want a remove-function. I already got it working that it removes an element with a specific value, but I want it so that it removes an element with an specific index. How can I find out the index of the elements in my list?
Posted 6-Dec-12 5:22am
Edited 6-Dec-12 5:24am
v2
Comments
yaser shadmehr at 6-Dec-12 10:23am
   
it is related to C#? not OPENGL
Member 9655506 at 6-Dec-12 10:25am
   
thx

1 solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 520
1 Maciej Los 205
2 Suvendu Shekhar Giri 159
3 Peter Leow 140
4 Kornfeld Eliyahu Peter 133
0 Sergey Alexandrovich Kryukov 9,623
1 OriginalGriff 8,895
2 Peter Leow 5,044
3 Kornfeld Eliyahu Peter 3,333
4 Maciej Los 2,561


Advertise | Privacy | Mobile
Web01 | 2.8.150327.1 | Last Updated 6 Dec 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100