| | |
recusive method problem
Please support our C# advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Feb 2007
Posts: 7
Reputation:
Solved Threads: 0
after finishing while loop,when it wants to quit the recursive( node curr) method,it comes back again to the recursive call(recursive (nod)) in the for loop and it traps in several loops till an exception occurs saying that "index was out of the rang of the array" .
can anyone help please...
can anyone help please...
publicvoid recursive(Node curr) { while ( sour <= source.Length - 2) { for (int i = 0; i < curr.ChildNumber; i++) { nod = (Node)curr.nextNode[i]; while (source[sour] != nod.CurrentNodeName) { continue; } sour = sour + 1; Console.WriteLine(nod.CurrentNodeName); recursive((Node)nod); } sour = sour + 1; } }
•
•
Join Date: Jan 2006
Posts: 275
Reputation:
Solved Threads: 11
You have all your logic in a big tangled mess.
I suggest you start by writing in pseudo code what you want to do and then code. You have while loops that do nothing, while loops inside for loops inside while loops and call the same method inside all those loops. A recipe for disaster.
You can simplify this greatly.
I suggest you start by writing in pseudo code what you want to do and then code. You have while loops that do nothing, while loops inside for loops inside while loops and call the same method inside all those loops. A recipe for disaster.
You can simplify this greatly.
![]() |
Similar Threads
- How to call Client.java from HTML? (Java)
- Problem while installing linux (*nix Software)
- gets() problem in C (C)
- Help with replace method. (Java)
- Windows XP Proffesional - Explorer problem (Windows NT / 2000 / XP)
- XP won't restart, keeps rebooting (Windows NT / 2000 / XP)
- Guestbook help. Post in two different spots. (Perl)
Other Threads in the C# Forum
- Previous Thread: workink with list box in GUI
- Next Thread: Help Needed in C# (picture viewer)
| Thread Tools | Search this Thread |
.net access algorithm array barchart bitmap box broadcast c# check checkbox client combobox control conversion csharp custom customactiondata database datagrid datagridview dataset datastructure date/time datetime datetimepicker degrees development dll draganddrop drawing encryption enum event excel file filename files form format forms function gdi+ gis gtk hash httpwebrequest image index input install java label list listbox mandelbrot math mouseclick mysql operator outlook2003 path photoshop picturebox pixelinversion pixelminversion post programming radians regex remoting richtextbox server sleep snooze socket sql statistics stream string table tables tcp text textbox thread time timer update usercontrol usercontrols validation visualstudio webbrowser webcam wia windows winforms wpf xml





