Click here to Skip to main content
15,911,711 members
Home / Discussions / C#
   

C#

 
QuestionCommunicating with user controls Pin
KabirPatel3-Oct-08 4:38
KabirPatel3-Oct-08 4:38 
AnswerRe: Communicating with user controls Pin
Pedram Behroozi3-Oct-08 5:00
Pedram Behroozi3-Oct-08 5:00 
QuestionRe: Communicating with user controls Pin
nelsonpaixao3-Oct-08 13:13
nelsonpaixao3-Oct-08 13:13 
Questionexcel cell alignment Pin
michael_jhons3-Oct-08 4:04
michael_jhons3-Oct-08 4:04 
AnswerRe: excel cell alignment Pin
Pedram Behroozi3-Oct-08 4:50
Pedram Behroozi3-Oct-08 4:50 
GeneralRe: excel cell alignment Pin
michael_jhons5-Oct-08 21:31
michael_jhons5-Oct-08 21:31 
AnswerRe: excel cell alignment Pin
minhlao21-Mar-09 17:14
minhlao21-Mar-09 17:14 
Questionref and out [modified] Pin
DaveyM693-Oct-08 1:29
professionalDaveyM693-Oct-08 1:29 
Am I correct in thinking that the only difference is:

ref has to be preassigned but does not have to be used in the method
out must be assigned before returning but can be unassigned before calling the method
?

Are there any notable benifits of using either one?

[edit] Just discovered that if using out, the parameter is treated as if it is unassigned (even if it's already been assigned) as soon as you call the method. So it appears that ref is kind of an input and output parameter whereas out is just output.[/edit]

Dave
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)

modified on Friday, October 3, 2008 7:37 AM

AnswerRe: ref and out Pin
Brij3-Oct-08 1:54
mentorBrij3-Oct-08 1:54 
GeneralRe: ref and out Pin
Guffa3-Oct-08 5:46
Guffa3-Oct-08 5:46 
AnswerRe: ref and out Pin
Ennis Ray Lynch, Jr.3-Oct-08 4:17
Ennis Ray Lynch, Jr.3-Oct-08 4:17 
GeneralRe: ref and out Pin
led mike3-Oct-08 4:32
led mike3-Oct-08 4:32 
GeneralRe: ref and out Pin
Ennis Ray Lynch, Jr.3-Oct-08 4:33
Ennis Ray Lynch, Jr.3-Oct-08 4:33 
GeneralRe: ref and out Pin
DaveyM693-Oct-08 5:14
professionalDaveyM693-Oct-08 5:14 
QuestionRe: ref and out Pin
led mike3-Oct-08 5:39
led mike3-Oct-08 5:39 
AnswerRe: ref and out Pin
DaveyM693-Oct-08 6:50
professionalDaveyM693-Oct-08 6:50 
GeneralRe: ref and out Pin
Mark Salsbery3-Oct-08 5:57
Mark Salsbery3-Oct-08 5:57 
GeneralRe: ref and out Pin
DaveyM693-Oct-08 5:01
professionalDaveyM693-Oct-08 5:01 
GeneralRe: ref and out Pin
Dan Neely3-Oct-08 5:48
Dan Neely3-Oct-08 5:48 
GeneralRe: ref and out Pin
Guffa3-Oct-08 5:51
Guffa3-Oct-08 5:51 
GeneralRe: ref and out Pin
Ennis Ray Lynch, Jr.3-Oct-08 6:12
Ennis Ray Lynch, Jr.3-Oct-08 6:12 
GeneralRe: ref and out Pin
DaveyM693-Oct-08 7:00
professionalDaveyM693-Oct-08 7:00 
GeneralRe: ref and out Pin
Guffa4-Oct-08 4:26
Guffa4-Oct-08 4:26 
GeneralRe: ref and out Pin
Ennis Ray Lynch, Jr.4-Oct-08 6:40
Ennis Ray Lynch, Jr.4-Oct-08 6:40 
GeneralRe: ref and out Pin
Guffa4-Oct-08 8:36
Guffa4-Oct-08 8:36 

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.