Click here to Skip to main content
15,899,825 members
Home / Discussions / C#
   

C#

 
GeneralListView Column Width resize Pin
ARBR9-Jul-05 2:01
ARBR9-Jul-05 2:01 
GeneralRe: ListView Column Width resize Pin
mav.northwind9-Jul-05 20:52
mav.northwind9-Jul-05 20:52 
GeneralSet up problem Pin
ksanju10009-Jul-05 1:30
ksanju10009-Jul-05 1:30 
GeneralListView - Columns collection design-time question Pin
iliyang8-Jul-05 23:51
iliyang8-Jul-05 23:51 
QuestionPass byte array? Pin
Dominik Reichl8-Jul-05 23:08
Dominik Reichl8-Jul-05 23:08 
AnswerRe: Pass byte array? Pin
User 20930738-Jul-05 23:25
User 20930738-Jul-05 23:25 
GeneralRe: Pass byte array? Pin
S. Senthil Kumar8-Jul-05 23:51
S. Senthil Kumar8-Jul-05 23:51 
AnswerRe: Pass byte array? Pin
S. Senthil Kumar8-Jul-05 23:50
S. Senthil Kumar8-Jul-05 23:50 
Passing it as a byte[] will pass the array by reference, as System.Array is a reference type. Because the array is passed by reference, the called function can modify the values in the array and the calling function will see the modified values. That is, if the called function looks like
void Test(byte[] byteArray)
{
   byteArray[0] = 23;
}

then the calling function will get 23 when it indexes byteArray[0].

There is no way you can avoid this, the only workaround is to pass a copy of the data in the array.

However, the called function cannot change the array reference itsef. That is, if it does
void Test(byte[] byteArray)
{
   byteArray = new byte[2];
}

then the calling code will *not* see the modified reference. If you want the calling code to see the modified reference, you need to add the ref keyword.

Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
GeneralRe: Pass byte array? Pin
User 20930739-Jul-05 0:27
User 20930739-Jul-05 0:27 
GeneralRe: Pass byte array? Pin
S. Senthil Kumar9-Jul-05 0:38
S. Senthil Kumar9-Jul-05 0:38 
GeneralRe: Pass byte array? Pin
Dominik Reichl9-Jul-05 0:46
Dominik Reichl9-Jul-05 0:46 
QuestionCreate executable? Pin
Expert Coming8-Jul-05 21:43
Expert Coming8-Jul-05 21:43 
AnswerRe: Create executable? Pin
User 20930738-Jul-05 23:21
User 20930738-Jul-05 23:21 
GeneralRe: Create executable? Pin
Expert Coming9-Jul-05 9:38
Expert Coming9-Jul-05 9:38 
GeneralRe: Create executable? Pin
Mathew Hall9-Jul-05 23:13
Mathew Hall9-Jul-05 23:13 
GeneralRe: Create executable? Pin
delfme15-Jul-05 13:25
delfme15-Jul-05 13:25 
Generalneed help regarding adding components in C# and VC (Managed) Pin
arusmemon8-Jul-05 20:36
arusmemon8-Jul-05 20:36 
GeneralRe: need help regarding adding components in C# and VC (Managed) Pin
Rob Graham9-Jul-05 6:10
Rob Graham9-Jul-05 6:10 
Questionhow to open a dial up internet connection from my aplication Pin
Pablo Riera8-Jul-05 18:57
Pablo Riera8-Jul-05 18:57 
AnswerRe: how to open a dial up internet connection from my aplication Pin
User 20930738-Jul-05 19:11
User 20930738-Jul-05 19:11 
GeneralRe: how to open a dial up internet connection from my aplication Pin
ksanju10009-Jul-05 2:06
ksanju10009-Jul-05 2:06 
GeneralE-Mail Pin
Expert Coming8-Jul-05 16:57
Expert Coming8-Jul-05 16:57 
GeneralRe: E-Mail Pin
Rob Graham8-Jul-05 17:28
Rob Graham8-Jul-05 17:28 
GeneralRe: E-Mail Pin
Expert Coming8-Jul-05 20:40
Expert Coming8-Jul-05 20:40 
GeneralRe: E-Mail Pin
User 20930738-Jul-05 23:34
User 20930738-Jul-05 23:34 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.