Click here to Skip to main content
14,328,979 members

.NET Framework

 
Questionintegrating visual studio.net 2003 or 2005 with autocad or 3d studio max Pin
mestkaniasa25-Feb-07 8:53
membermestkaniasa25-Feb-07 8:53 
Questionhelp on project biulding Pin
thesad25-Feb-07 3:17
memberthesad25-Feb-07 3:17 
AnswerRe: help on project biulding Pin
Colin Angus Mackay25-Feb-07 4:03
memberColin Angus Mackay25-Feb-07 4:03 
GeneralRe: help on project biulding Pin
thesad25-Feb-07 6:12
memberthesad25-Feb-07 6:12 
Question.NET Security Configuration Pin
Ian Uy24-Feb-07 16:17
memberIan Uy24-Feb-07 16:17 
AnswerRe: .NET Security Configuration Pin
Colin Angus Mackay25-Feb-07 4:02
memberColin Angus Mackay25-Feb-07 4:02 
QuestionGeneral question about object reference in .NET Framework Pin
Yanshof24-Feb-07 10:07
memberYanshof24-Feb-07 10:07 
AnswerRe: General question about object reference in .NET Framework Pin
Luc Pattyn24-Feb-07 10:59
professionalLuc Pattyn24-Feb-07 10:59 
Hi,

without out/ref function arguments are passed:
- by value (=the value of the thing is put on stack) for value types such as int and struct
- by reference (=the address of the object is put on stack) for reference types such as Form

with ref added, an additional indirection is used, which means when the function argument
was some variable, rather than passing the variable (as stated above) a pointer to it gets
passed, allowing the callee to modify that variable.

This allows for a method to have multiple outputs: one return value and any number of "ref"
arguments.

So you could create a method
void getThreeCoordinates(ref int x, ref int y, ref int z) {x=1; y=2; z=3;}
When called as:
int a=2, b=3, c=4;
getThreeCoordinates(ref a, ref b, ref c);
all three local variables would be changed.

A ref argument needs to have a value before it can be passed with ref; an out argument does not.
(So the example would not need initial values if out had been used).

All of this can be found in any reference manual on C# of course.

Smile | :)


Luc Pattyn

[My Articles]

GeneralRe: General question about object reference in .NET Framework Pin
Yanshof24-Feb-07 19:19
memberYanshof24-Feb-07 19:19 
GeneralRe: General question about object reference in .NET Framework Pin
Luc Pattyn24-Feb-07 23:20
professionalLuc Pattyn24-Feb-07 23:20 
QuestionXML inside WebBrowser control causes large delay when unloading the control Pin
Michael Wolski23-Feb-07 3:38
memberMichael Wolski23-Feb-07 3:38 
AnswerRe: XML inside WebBrowser control causes large delay when unloading the control Pin
Michael Wolski23-Feb-07 3:54
memberMichael Wolski23-Feb-07 3:54 
QuestionImplementing some broadcast udp protocol Pin
ohad_2923-Feb-07 3:31
memberohad_2923-Feb-07 3:31 
QuestionMailMessage.From vs. MailMessage.Sender in .NET 2.0 Pin
SindyatIndy22-Feb-07 6:29
memberSindyatIndy22-Feb-07 6:29 
AnswerRe: MailMessage.From vs. MailMessage.Sender in .NET 2.0 Pin
Scott Dorman22-Feb-07 18:02
professionalScott Dorman22-Feb-07 18:02 
AnswerRe: Which one is faster? Pin
Pete O'Hanlon21-Feb-07 23:05
protectorPete O'Hanlon21-Feb-07 23:05 
GeneralRe: Which one is faster? Pin
Dave Kreskowiak22-Feb-07 3:20
mveDave Kreskowiak22-Feb-07 3:20 
GeneralRe: Which one is faster? Pin
Pete O'Hanlon22-Feb-07 3:43
protectorPete O'Hanlon22-Feb-07 3:43 
GeneralRe: Which one is faster? Pin
Scott Dorman22-Feb-07 18:04
professionalScott Dorman22-Feb-07 18:04 
QuestionConverting from Base Class to Child Class Pin
bertvan21-Feb-07 21:43
memberbertvan21-Feb-07 21:43 
AnswerRe: Converting from Base Class to Child Class [modified] Pin
Colin Angus Mackay21-Feb-07 22:16
memberColin Angus Mackay21-Feb-07 22:16 
GeneralRe: Converting from Base Class to Child Class Pin
bertvan21-Feb-07 22:40
memberbertvan21-Feb-07 22:40 
GeneralRe: Converting from Base Class to Child Class Pin
Colin Angus Mackay21-Feb-07 23:51
memberColin Angus Mackay21-Feb-07 23:51 
Questionif there any disadvantageof using dot net 2.0 and 1.1on same server Pin
JayPrakash Kulkarni21-Feb-07 19:56
memberJayPrakash Kulkarni21-Feb-07 19:56 
AnswerRe: if there any disadvantageof using dot net 2.0 and 1.1on same server Pin
Pete O'Hanlon21-Feb-07 23:02
protectorPete O'Hanlon21-Feb-07 23:02 

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.