|
List or dictionary would be a simple solution but unfortunately, I need to use the other classes. I can't figure out the implementation of the class using a List<t> in combination with the other classmodified on Friday, February 19, 2010 11:22 AM
|
|
|
|
|
joejack222 wrote: List or dictionary would be a simple solution but unfortunately, I need to use the other classes.
Make sure that it's worth the effort; the prebuilt classes are well-documented (meaning that they're easier to learn) and are used by lots of people (meaning that they're used in lots of conditions, and probably contain very little bugs).
joejack222 wrote: I can't figure out the implementation of the class using a List in combination with the other class
For your entertainment, your Linked List works on my system. I've only changed the names of your classes, and added some testcode;
class MyListNode
{
public string x;
public MyListNode Next;
}
class MyList
{
public MyListNode First;
}
class Program
{
public static void Main(string[] args)
{
MyList myList = new MyList();
myList.First = new MyListNode() {x="Hello"};
myList.First.Next = new MyListNode() {x="World"};
myList.First.Next.Next = new MyListNode() {x="from"};
myList.First.Next.Next.Next = new MyListNode() {x="CodeProject"};
MyListNode currentNode = myList.First;
while (currentNode != null) {
Console.WriteLine(currentNode.x);
currentNode = currentNode.Next;
}
Console.Write("Press any key to continue . . . ");
Console.ReadKey(true);
}
} Where are you having trouble?I are Troll
|
|
|
|
|
More information is required.
|
|
|
|
|
I want to implement 6 strings using a linkedlist. eventually want to make it bidirectional
|
|
|
|
|
I need to create 150 variable names. They must be like "varName01" , "varName01" all the way to 150. How do I do this using a for or while loop?
thanks!
Sundeep
|
|
|
|
|
There is never a technical need for this sort of thing. Consider using a Hash Table or an Array or a Stack or a Queue or another more appropriate data structure.
|
|
|
|
|
What are you doing with them anyway? Magic with Reflection.Emit ?
|
|
|
|
|
Message Closed
modified 23-Nov-14 6:44am.
|
|
|
|
|
What if its an array of objects?
class[] object = new class();?
|
|
|
|
|
sundeepan wrote: What if its an array of objects?
Nothing, no problem
|
|
|
|
|
heh, cool..so now i'm stuck at how to return all the elements of an array at the end of a method
I cant do
for(int i = 0; i < 20; i++)
{
return arrayOfObjects[i];
}
I will have unreachable code.
|
|
|
|
|
return will jump out of the method. What are you trying to do?
|
|
|
|
|
I am trying to return an array...but I cant do
return objectArray;
the compiler error:
Error 1 Cannot implicitly convert type 'Interactive.Geo.WellLog.Track.cgStackedTrack[]' to 'Interactive.Geo.WellLog.Track.cgStackedTrack' C:\Program Files\INT\Net\3.0.3693.0\Tutorials\WellLog.NET\StackedTrackTutorial\StackedTrackTutorial.cs 177 20 StackedTrackTutorial
|
|
|
|
|
Check definition of method - should return cgStackedTrack[] if you want to do this
|
|
|
|
|
Hey thanks!
I think I fixed it. Sorry for the stupid question...
|
|
|
|
|
Well obviously if you first say you're going return something of type T and then decide to return a T[] instead, that wouldn't work. Can you change the method signature, or is it fixed in some way?
|
|
|
|
|
Soooooo how did you think you were going to return the values of 150 different variables??
|
|
|
|
|
Do you really have a valid need to do this? Online only for only an hour a day. Please expect delay in response.
|
|
|
|
|
Well...yes..but I at the end I figured out that I did not need to create 150 variable names. An array worked fine.
Sorry for the newbie question, I am a newbie and basically I've learned not to be afraid of asking "newbie" or stupid questions. That's the way I learn....
once again I apologize f r my idiocy.
|
|
|
|
|
Dear Experts
I want to remove all the input tags from following html
<p>
<input id="00000000-0000-0000-1001-000000000000" type="button" value="Customer Job ID-JobData" />
</p>
<p>
<input id="00000000-0000-0000-1002-000000000000" type="button" value="Job Date-JobData" />
</p>
The output html should look like
<p>
</p>
<p>
</p>
I have tried a lot of using javascript and regexp but failed, Give me javascript code or RegExp to solve my problem please
Thanks in advance
|
|
|
|
|
Message Closed
modified 23-Nov-14 6:44am.
|
|
|
|
|
|
Demanding is very rude. Show what you've done and ask for help, but don't demand anyone give you code I know the language. I've read a book. - _Madmatt
|
|
|
|
|
If you're going to make demands like this, download this[^] tool and figure it out yourself.
Really, how hard could it be to look for "<input " and then "/>" or "</input>"...
|
|
|
|
|
I am trying following regular expression, but it is not working.
private string StripTagsRegex(string source)
{
return Regex.Replace(source, @"(\<[input][^\>]+\>)", string.Empty);
}
Please give me suggestion to solve my problem
|
|
|
|