| | |
passing array into a function
Please support our C# advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Nov 2006
Posts: 49
Reputation:
Solved Threads: 0
Hello there,
I have an array of 2 dimensional which i need to pass to a funtion,
but every time i try to send to the funcation "LoadScenario" it fails.
maybe my syntax is wrong,please take a look
Thanks Ahead
I have an array of 2 dimensional which i need to pass to a funtion,
but every time i try to send to the funcation "LoadScenario" it fails.
maybe my syntax is wrong,please take a look
Thanks Ahead
string[,] Vars = newstring[5,4]; Vars[0,1]="Calculos"; Vars[1,1]=" 1"; Vars[2,1]=" 2"; Vars[3,1]=" 3"; Vars[0,0]="General"; Vars[1,0]=" 4"; Vars[2,0]=" 5"; Vars[3,0]=" 5"; Vars[4,0]=" 6"; LoadScenario(Vars); ------------------------ privatevoid LoadScenario(string Vars1) { //do something }
he probably left off his method declaration
C# Syntax (Toggle Plain Text)
private void LoadScenario( string[,] Vars ) { } //but if you only need one portion of the string in vars private void LoadScenario(string Vars) {} //then call like this.. //assume we are inside of a class at this point LoadScenario(vars[x,y]); //where x is some int within bounds //where y is some int within bounds
Dont forget to spread the reputation to those that deserve!
![]() |
Similar Threads
- Passing 2D Array of Pointers into a function (C++)
- Passing an array to a function (C)
- Passing a matrix from main function to user defined function. (C++)
- Passing array of structures into a function (C++)
- Having trouble passing bool type to function....need help (C++)
- help with questions (Java)
Other Threads in the C# Forum
- Previous Thread: populte treeView control with xml file
- Next Thread: a few days in C# and already needs helP
| Thread Tools | Search this Thread |
.net access algorithm array barchart bitmap box broadcast c# check checkbox client combobox control conversion csharp custom cyclethruopenforms data database datagrid datagridview dataset datetime degrees development dll draganddrop drawing encryption enum event excel file finalyearproject form format forms function gdi+ getoutlookcontactusinfcsvfile globalization httpwebrequest image index input install installer java label list listbox mandelbrot math mono mouseclick mysql operator panel path photoshop picturebox pixelinversion post programming radians regex remote remoting richtextbox save server silverlight sleep socket sql sql-server statistics stream string table text textbox thread time timer timespan update upload usercontrol users validate validation visualstudio webbrowser wia windows winforms wpf xml





