Default is passing by value, but for reference types it means that you pass the value of the reference, e.g. the reference is copied, but the object that it refers to is not.
A reference is basically a pointer to the address where the actual data is stored, so when you pass the array to the method it's just a 32-bit pointer value that is really passed to it. The array itself is never copied.
In both your examples the method you call can alter the contents of the array, but in the second example it can also change the value of the reference, e.g. the secondarray variable.
I'm not directly getting what you are trying to achieve but if the only problem is that you can pass only one parameter to your thread function you could just pack more info into that one object parameter:
How to pass parameters between threads greatly depends on what exactly you want to do. As far as I see you are starting both thread paralell where the ReadOutput thread just writes some lines to the console and ReadInput waits for user input. In this scenario ReadOutput will probably be finished before the user can input anything.
Please try to explain what you are actually trying to achieve with your code. Than I will try to give you a good way to achieve your goal.
I have a treeview that I load from a dataset(baiscly files in a dir). I want to use the checkbox option in the treeview, when I uncheck a node it must be disabled. other app. can ask for the exsting nodes, I read this from the dataset not from the treeview.
beqause I load the treeview from a dataset I can not use the on_select method.
is there any way to put the treeview checkbox option in the dataset, and wacht if it change?
so that I can give the correct answer.
I don't think there is a direct way to solve this problem. But you could add a boolean column to your DataSet tables and when the check state changes in the tree you could change the values in this column. This way other components using the DataSet would just need to react on the RowChanged event.
I have the answer for you...just solved it in my game I'm writing. Unfortunately my machine died last night (and is now on the curb for trash pickup) and the answer is sitting on my couch in the drive cage!!!
I had to tinker with things a bit but I did get it to work.
I'm working with Crystal reports and c# windows application. my report is bind using stored procedure to database that accepts 3 parameters. Now I want to add one more stored procedure with same 3 parameters to this report. but crystal report gives following error :
Description: One of the parameter is not supplied
SQL State: 42000
Native Error: 201 [Database Vendor Code: 201]
I'm starting a process with ProcessStartInfo, setting the 'Arguments' property to a filepath to the file I want to start the process with. However, the process I start is complaining about the filepath - since the filepath has spaces in it, it only seems to pass to the process the filepath upto the first space, and then ignores the rest. The process I'm trying to start is regsvr32.exe and the argument is a filepath to a dll I want to register. Could anyone please help me?
the problem is that when I am trying to set this string with a value, I'm getting a StackOverFlow!
I debugged it, and the value contains the string, but for some reason it keeps on calling itself over and over till the stack is full.
any idea why it happens?!
Thanks in advance!
Last Visit: 31-Dec-99 19:00 Last Update: 1-Dec-22 10:21